Skip to content

Commit

Permalink
HOSTSD-310 Update Data Service (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fosol authored Mar 26, 2024
1 parent 795b615 commit 242d6af
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/data-service/Helpers/ServiceNowApiService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ public ServiceNowApiService(
try
{
var response = await this.SNClient.SendAsync(uri, method);

// Treat a 404 like a 204 because so many API developers do this... It's annoying because it results in the same error if the endpoint doesn't exist.
if (response.StatusCode == System.Net.HttpStatusCode.NotFound) return null;

response.EnsureSuccessStatusCode();

var json = await response.Content.ReadAsStringAsync();
Expand Down

0 comments on commit 242d6af

Please sign in to comment.