Questions tagged [http-status-code-204]

The HTTP response status code 204 No Content

The server has successfully fulfilled the request and that there is no additional content to send in the response payload body.

68 questions
1
vote
1 answer

Why do I get a "Invalid JSON" when Status Code 204?

I don't know if it is intended or not. But when I use a Reponse Code 204 in my Controller I get "Invalid JSON was returned from the route" in PHPunit. But if I change the Response Code to 201, everything works fine... Why? protected function…
Philipp Mochine
  • 4,351
  • 10
  • 36
  • 68
1
vote
1 answer

What is a correct RESTful service response to a PUT request on successful update?

What is a correct RESTful service response to a PUT request on successful update? There are two possible responses that seem to comply with REST architectural style: Return only a header without body with the status 204. Header: content-type:…
1
vote
2 answers

How do I unit test an Angular HttpClient 204 response?

Our REST service returns 204's for a no data scenario. But I cannot figure out how to test for this scenario. it('can handle no data', (done) => { const testData = service.getDummyData(); service.dataChanged$.subscribe( (data: Data[]) => { …
1
vote
0 answers

AngularJS: Error 204 (no content)

I have this Angular Controller: (function () { "use strict"; angular.module('appContacts') .controller('organizationsController', function organizationsController(dataService, $stateParams) { var vm = this; …
Rafael Munoz
  • 636
  • 1
  • 7
  • 27
1
vote
2 answers

Flask abort() with custom http code

I use Flask framework in my project with pure json api. It renders only json responses without html or static files. I am trying to achieve abort() function with custom http code, in my case 204 (No Content) which isn't defined by default. I have…
gpolek
  • 27
  • 1
  • 6
0
votes
1 answer

Returning 204 No Content from Actix Web

I have a function, with the signature: async fn index(bearer_control: web::Json) -> Result { It is used an a web server: HttpServer::new(|| App::new().route("/", web::post().to(index))) .bind_openssl("127.0.0.1:1618",…
fadedbee
  • 42,671
  • 44
  • 178
  • 308
0
votes
0 answers

Generated Code from Swagger tries to parse empty body from 204 response

We have problem with our generated API consumers. Tried typescript-fetch and Java-SpringBoot generators. If the endpoint has no documents for given id, the endpoint responses with a 204 code and an empty body. But the generated controller code tries…
0
votes
0 answers

BCrypt error Illegal arguments: undefined, string

I tried to register a user but everytime I did it I get this error: C:\Users\reut\Desktop\Final-Project-2-main\server\node_modules\bcryptjs\dist\bcrypt.js:189 throw Error("Illegal arguments: "+(typeof s)+', '+(typeof salt)); …
0
votes
0 answers

Why does MS Graph calendar event deletion respond with Transfer-Encoding header, violating the HTTP spec?

My application has been in production for several months and everything worked fine. Howwever, since February 24, 2023, whenever it deletes a calendar event via DELETE /me/calendars/{id}/events/{id}, the response from Microsoft Graph includes a…
0
votes
0 answers

CORS Issue 204 using frontend Angular and .NET Core 6

I have built a website. I can access the webpage using Chrome, Firefox, Opera, and Edge. However, on Safari, I get errors. This was working fine until five days go I started to get these errors. Even reverting to the old version did not resolve the…
Krishneil
  • 1,432
  • 1
  • 18
  • 26
0
votes
1 answer

getting options 204 while using cloudinary api resources

I am using cloudinary to fetch my images and everything works fine but it sends a 204 preflight res when using cloudinary and when i remove cloudinary logic it works normal. login Controller const gender = await getGender(username); …
0
votes
1 answer

dotnet-isolated azure function container loads 0 of 1 function from metadata and then gives http status 204 (content not found)

I have .net 6 isolated function docker container that works locally but not in azure. The docker file copies the build output binaries to the home/site/wwwroot directory of the container based on the image…
Paul
  • 693
  • 1
  • 10
  • 25
0
votes
0 answers

Google analytics API issue 204

Reference to follow purchase event: https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference?client_type=firebase when I call this API, I always get 204 response code, so what is the reason?
0
votes
1 answer

django http response 204 redirecting to blank page only in safari

I have a view button that triggers a javascript function. The JS function is made to display a modal popup and then redirect to a URL that returns HTTP 204 response. return HttpResponse(status=204). this is the js code function count(){ …
0
votes
1 answer

ASP.NET Core Web API - Return a string message with a NoContent Response?

I have some records in the database that may or may not have some information for a certain column, and that's OK. If a consumer of the endpoint runs into one of these records, I'd like to return "NoContent", because, well, there's No Content for…