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
20
votes
3 answers

Retrofit, callback for 204 No Content response?

On Android, I initially implemented a Retrofit interface like this: @DELETE(USER_API_BASE_URL + "/{id}") public void deleteUser(@Path("id") String id, Callback callback); The server returns 204 NO CONTENT upon a successful deletion. This was…
ticofab
  • 7,551
  • 13
  • 49
  • 90
11
votes
1 answer

Firefox console throws "no element found" on HTTP 204 response

Everything actually works, but I can't get rid of this error in the firefox console: no element found I am sending an HTTP request to my api: $http({ url: API_LOCATION + 'expenses/' + obj.expense.id + '/', method:…
Skatch
  • 2,112
  • 2
  • 14
  • 32
9
votes
2 answers

Normal to see Status 204 then Status 200?

I am looking at my ajax request in network tab in chrome and I noticed every ajax request I do happens twice. First one is a 204 and then followed up with 200. My ajax call is only being hit once so I am not sure why there are 2. Edit So it seems to…
chobo2
  • 83,322
  • 195
  • 530
  • 832
8
votes
0 answers

Why does Chrome mark a "204 No Content" response red?

I'm very confused by chrome, it marks a "204 No Content" response red in the request list but at the same time has a green point for the "Status Code". I'm sure 204 isn't an error so what happens here? I've created a new script to ensure that there…
7
votes
1 answer

HTTP GET 200 vs 204

We are designing a public API, and trying to figure out what is the best practice for GET with following cases: Path param: /orders/{orderId} Found: 200 with a response body. Not Found: 404. Query…
6
votes
3 answers

How can I return a 204 rather than 404 for a missing favicon.ico file in Nginx?

For my sites I typically have two server{} blocks: one serves the site, and the other serves static content for that site from a different domain. Because the favicon.ico file is always asked for from the primary domain instead of the static domain,…
Bryson
  • 1,186
  • 2
  • 13
  • 26
5
votes
2 answers

ASP.NET controller action returns status code 200 but EndRequest has it as 204 (NoContent)

In my ASP.NET MVC application controller processes a request and returns a specific view with a status code 200. When it gets to Application_EndRequest it's already 204. The response content of my view is correct and is in the response, so only the…
Mando
  • 11,414
  • 17
  • 86
  • 167
5
votes
2 answers

MSIE/Edge uses HTTP HEAD for data URLs, then treats 204 response as error?
Background: My PHP code handles typical HTTP HEAD requests by sending either an HTTP status 404 response or a 204 response. This seems correct to me, since RFC7231 specifies HTTP status 204 as: 6.3.5. 204 No Content The 204 (No Content) status…
5
votes
2 answers

Flask test_client can't handle HTTP 204 No data

I have delete endpoint, returning HTTP 204 @blueprint.route('/foo', methods=['DELETE']) def delete_tag(id): # .... return '', 204 and I want to test it def test_delete_tag(self): resp = self.client.delete(url_for('tags.delete_tag',…
farincz
  • 4,943
  • 1
  • 28
  • 38
5
votes
2 answers

Android Volley library not working with 204 and empty body response

I'm using the latest Volley library and I'm having issues when my api is returning a 204 with no body in the response. It seems that the following code in BasicNetwork.java isn't working as expected: // Some responses such as 204s do not have…
Ankur22
  • 103
  • 3
  • 10
4
votes
1 answer

No Content in Spring Boot Rest

How do I configure Spring Boot to return 204 in GET methods (typically findAll methods) when the method does not fetch records? I would not like to do treatment in each method, type the code below: if(!result) return new…
Luciano Borges
  • 817
  • 3
  • 12
  • 31
3
votes
3 answers

What is the appropriate HTTP status code for a null or missing object attribute?

Let's say we have an API with a route /foo/ that represents an instance of an object like this: class Foo: bar: Optional[Bar] name: str ... class Bar: ... (Example in Python just because it's convenient, this is about the HTTP…
Glyph
  • 31,152
  • 11
  • 87
  • 129
3
votes
1 answer

HTTP 204 leads to download in Chrome

when I try to Respond with on HTTP 204 Status, my Chrome browser is starting an Download that fails. Request: Request URL: https://dummy.page/dummyRequest Request Method: GET Status Code: 204 Remote Address: [dummy]:443 Referrer…
3
votes
1 answer

Rails 5 No template found error

Error in terminal while running rails s: Started POST "/users/confirm" for ::1 at 2017-01-28 15:12:30 -0600 Processing by UsersController#confirm as HTML No template found for UsersController#confirm, rendering head :no_content It seems that this…
user6332345
3
votes
1 answer

How to rightly detect iframe was loaded with response 204 No Content?

For more clarity I made it simple (so let's presume that iframe.attr() will be called after previous load was fully completed): var iframe = $("iframe"); var counter = 0; var trackLoads = function(){ console.log("I was loaded:" + counter); …
martin jrk
  • 185
  • 10
1
2 3 4 5