Questions tagged [http-status-codes]

HTTP status codes are a set of standardized codes returned in an HTTP web response. Questions about why a service is (unexpectedly) returning a status code should not use this tag.

For a full list of the status codes see the HTTP 1.1 specification, WebDAV specification, RFC 6585, and the IANA list of status codes.

HTTP status codes have specific meanings which are outlined in the specification that they were created in. They can be used in contexts outside of what the specification states, but must adhere to any conditions that have been established in the specification.

1693 questions
0
votes
1 answer

Appropriate Status Code for Incorrect Requested Type

If you have a REST API that can be used to access a unique owner and then one registered pet - what kind of status code would be most appropriate to signify that a Pet exists, but is not found at the current URL? /Owner/{id} -- Get operation to…
0
votes
0 answers

Swagger always showing code 0 with No Content message

I have this @RestController method in my SpringBoot Application: @ApiOperation(value = "fetch") @RequestMapping(value = "/", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public ResponseEntity
Chayma Atallah
  • 725
  • 2
  • 13
  • 30
0
votes
0 answers

REST API: What should be status code if incorrect source is passed by the client?

In our API, we ask mandatorily for client source in the http request header with values as: 1-Desktop 2-Mobile 3-Apps What should be status code returned if we get header input other than 1,2,3. Should it be bad request or unauthorized?
Sahil Sharma
  • 3,847
  • 6
  • 48
  • 98
0
votes
1 answer

How can i get http response code more quickly in java than getResponseCode?

I want to get http response code of over 10000000 web sites. So, I used Http(s)?URLConnection class in java. Code is HttpURLConnection http = (HttpURLConnection)address.openConnection(); http.setReadTimeout(300000); return…
Mastojun
  • 202
  • 1
  • 2
  • 9
0
votes
2 answers

Status codes for JWT Token cases

The authentication is achieved using JWT. It is suggested to use 401 status code for all the expiry/invalidity cases of the token. But, the retry with refresh token from client-side should be done only on the 'expired' case, not on the 'invalidity'…
0
votes
1 answer

PHP status code

I need to get a status code in a Wordpress plugin (already set). Until now I was using http_response_code(), but now I have to run the plugin on a server with an older version of php which doesn't support http_response_code(). What is the…
Corina
  • 15
  • 7
0
votes
2 answers

Reason for NoHttpResponseException

Can any one suggest the reason for getting NoHttpResponseException?? My application is constantly recieving this exception from a service. Is this a client side issue or server side? How to debug with these kinds of Issues? Following is the…
Don Jose
  • 1,448
  • 2
  • 13
  • 27
0
votes
1 answer

REST API response status code when a related object fails to save

I have a rest API that acts like a wrapper for a couple of other external APIs. Saving a local session object plus two objects based on the responses of those APIs. A successful call will result in something like this: { session { …
arcticfeather
  • 195
  • 1
  • 9
0
votes
1 answer

header status returned on this request

having this request : // set a cookie to requested locale app.get('setlocale/:locale', function (req, res) { res.cookie('locale', req.params.locale); //set language in cookie if(req.param.locale === "es"){ res.redirect('/es');…
MikZuit
  • 684
  • 5
  • 17
0
votes
1 answer

Node HTTP Server - How do you send a Suceess/Fail status code asynchronously after a db write?

I have a pretty simple question with respect to setting status codes after a database write. Let's say you're saving a new document to an object collection with something like mongoose. The following is inside a POST handler to some route, after…
MFave
  • 1,044
  • 2
  • 8
  • 19
0
votes
0 answers

HTTPS Response Status nightwatchjs

How to check HTTPS Response Status for all links in a webpage using nightwatch? "HttpResponse": function (client) { var http = require("http"); client.maximizeWindow() .url('https://www.google.co.in'); …
0
votes
0 answers

node.js RangeError: Invalid status code: -1

Error stack trace: _http_server.js:188 throw new RangeError(Invalid status code: ${originalStatusCode}); ^ RangeError: Invalid status code: -1 at ServerResponse.writeHead (_http_server.js:188:11) at ServerResponse.writeHead…
saman
  • 1
  • 2
0
votes
2 answers

Can someone explain how this http status code is processed?

I am wondering what ~(event.status / 100) > 3 is doing in the below code taken from here? Is there a class of errors > 399? Why do we need ~ here? @Injectable() export class AuthInterceptor implements HttpInterceptor { intercept(req:…
sabithpocker
  • 15,274
  • 1
  • 42
  • 75
0
votes
1 answer

Change https header 302 to 200 in PHP

E-Commerce website has product page and category page. Now when user visiting any product and if not available then user will redirect to category page with 302 header status code of product page, I want to change that from 302 to 200, How can I…
Vishal Ghantala
  • 86
  • 1
  • 16
0
votes
1 answer

What status code to return when an invalidly generated link has been clicked?

Consider the following situation: I have a MVC setup where the view invokes a mapper to get a specific URL for a href attribute. The mapper holds keys to make the referencing easy. Now the view requests an invalid key, so the mapper responds with…
Martin B.
  • 1,567
  • 14
  • 26