Questions tagged [http-status]

The status code describes the state of the response from the web server.

Each Status-Code is described in the W3C HTTP 1.1 specifications, including a description of which method(s) it can follow and any metainformation required in the response.

78 questions
0
votes
3 answers

how to control the http status code properly?

I met a strange thing when test the 400 error handling in CodeIgniter. Message: Cannot modify header information - headers already sent by (output started at ...) And the http status code is always 200, finally I found that there is a new line…
Fourj
  • 1,817
  • 1
  • 18
  • 34
0
votes
2 answers

Which HTTP status should I return if the client tries to upload a new file while server is still processing the previous one?

My application has a button for allowing the user to upload a file. Uploading the file is very quick, we send the response to the client very quickly, but the service takes a while to process it. The user can only upload a new file when the previous…
Igor Alves
  • 68
  • 7
0
votes
1 answer

Which is the proper response code for this scenario - 207 vs 400 status code

I am designing the API where all the following three cases are possible All the inputs in the array are correct, so this API will return the 200 status code Sample output: 200 Status code [{ "status" : "success", "value" : "some response" }, {…
Harry
  • 3,072
  • 6
  • 43
  • 100
0
votes
1 answer

Correct http status for invalid config in request body?

I am having trouble picking the correct HTTP Status for when an API is receives an attribute that maps additional data in the system but that additional data is not found. I was initially thinking 422 since it describes the use case but sounds like…
Dot Batch
  • 608
  • 6
  • 17
0
votes
1 answer

REST API response status code - search GET that returns a single result

In case we have a search GET REST API endpoint that returns one or zero results for the currently logged in customer, I am wondering what the correct response status code would be, for instance: api/subscriptions?productId=1 According to the…
Armino
  • 129
  • 1
  • 1
  • 11
0
votes
1 answer

HTTP status quote when a resource can't be inserted but could be fixed by the client

I have a resource I want to insert via POST; say a reservation. In some cases, the server can't insert the given object, but needs to give feedback to the user, what needs to change in order to be able to insert it. For example if you send a…
0
votes
2 answers

Is there any possibility to get status code i.e. (200,301,302) after loading html page in CefSharp C#?

I'm facing a problem that I can't get a response status code after loading the HTML website in CefSharp C# project. There are a few methods like OnLoadingStateChange called after loading the new page in a browser. The main problem is I do no how to…
0
votes
0 answers

Detecting 413 (or other HTTP Status) in PHP

I Send Data to a webserver with POST or PUT method (server is FreeBSD, Apache httpd, php72). I want to detect a 413 (too large) in my PHP script. But var_dump(http_response_code()); gives 200 even i uploaded data was too large (Apache httpd answers…
DPLW
  • 1
  • 1
0
votes
1 answer

HTTP response for "logged in and trying to register"

Say a REST client is logged in and attempts to register, in which case the server ignores the request. What status should be returned here?
Baterka
  • 3,075
  • 5
  • 31
  • 60
0
votes
1 answer

Suitable http status code for extra authentication step when it's not provided or didn't match

Problem The application expects the client to send the header Authorization with the access token on most of the routes. Now there is a new feature and some new few routes expect not only the Authorization header but also a pin attribute with a…
Mateus Pires
  • 903
  • 2
  • 11
  • 30
0
votes
1 answer

What is the correct success status code for Preflights(option) request?

We're developing new frontend (angular) for our older backend (java). After enabling cors all requests(POST) are working as expected. But preflights(option) request response with 'status code 202 OK'. So before digging in and change 'the working…
Pradeepal Sudeshana
  • 908
  • 2
  • 14
  • 30
0
votes
1 answer

REST API - HTTP status for a partial response

I encounter the following case: I have an API that allows me to retrieve a unique resource: GET myapi/resource_id If this resource does not exist, I return a 404 HTTP status code. This API also allows to retrieve several resources via the same…
JCDUS
  • 1
  • 2
0
votes
1 answer

What response code Apache throws when it max out?

I use Apache 2.4 as web server. When it exceeds max connections limit, what response code the client receives from the web server?
Tanu Gupta
  • 602
  • 1
  • 11
  • 26
0
votes
3 answers

Best way to concurrently check urls (for status i.e. 200,301,404) for multiple urls in database

Here's what I'm trying to accomplish. Let's say I have 100,000 urls stored in a database and I want to check each of these for http status and store that status. I want to be able to do this concurrently in a fairly small amount of time. I was…
MAP
  • 742
  • 1
  • 9
  • 21
0
votes
1 answer

Using equal sign for HttpStatus.BAD_REQUEST not working

I'm just wondering why using == to check equality of HttpStatus.BAD_REQUEST is not working: HttpStatus httpStatusCode ...; if (httpStatusCode == HttpStatus.BAD_REQUEST) {} I got it working by using equals method: if…
Julez
  • 1,010
  • 22
  • 44