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

HTTP status code for "disabled temporarily"

I would like to return a HTTP status code if signups for my site are currently disabled. Would 503 work for this and/or is there a more appropriate code for this kind of request.
Alexis Tyler
  • 1,394
  • 6
  • 30
  • 48
0
votes
1 answer

Returning custom status and code on java rest api

I am looking for a way to have a custom status and error code that is outside the usual http range of error code. Something like this: return javax.ws.rs.core.Response.status(8001).entity("Error replacing document").build(); I get:…
Sathish Kumar
  • 313
  • 2
  • 15
0
votes
0 answers

Non-error HTTP Unauthorized status

Within our project we are using HTTP statuses to tell the client the state of their authentication. So when user is not logged in, the service will tell him 401. What is undesired is the fact that these will be logged in Google Chrome console…
Vojtěch
  • 11,312
  • 31
  • 103
  • 173
0
votes
1 answer

How to validate path params and explicitly set status codes in Rails

I am trying to set up a super simple RESTful endpoint (as an ApplicationController) that does simple path param validation and that returns a hardcoded JSON response: { "foo" : "123", "bar" : { "whistle" : "feather", "ping" : "pong" …
smeeb
  • 27,777
  • 57
  • 250
  • 447
0
votes
1 answer

HTTP Response Objects

Does every HTTP request need to be paired with a response? When you do some POST or DELETE actions, my understanding is that sometimes you don't need to send back data. I've always been told to send back an empty object, but is that necessary? Also,…
0
votes
2 answers

Is it possible to return HttpStatus status which is not from HttpStatus enum in Spring MVC

I want to return , 555 status code in response. I have checked ResponseEntity class of spring framework. I can see all constructors accept only particular codes from HttpStatus enum. This can be achieved by , return…
VedantK
  • 9,728
  • 7
  • 66
  • 71
0
votes
2 answers

WildFly 10.1.0.Final | Loading page during deployment | default-response-code is ignored

I wanted to distinguish between "deployment pending" and "deployment failed" and display a loading or a error page respectively. Therefore I tried to set the value default-response-code in the undertow configuration.
André
  • 464
  • 4
  • 17
0
votes
1 answer

Can't correctly read response of API call (JS)

I'm calling an API and getting results back as expected in JavaScript. If a 400 status is returned, I call another API, which I'm doing with an if statement. However, this "if" is never triggered, I think because the way my response is getting read.…
tx291
  • 1,251
  • 6
  • 24
  • 42
0
votes
2 answers

How to get HTTP Status code from Mule application

I am using Anypoint Studio 6.1 and Mule 3.8.1 and have a flow that calls MongoDB. I want to see how to get the HTTP status so I can configure my exception handling. When I disconnect MongoDB and run the Mule workflow it fails as expected, but the…
user3165854
  • 1,505
  • 8
  • 48
  • 100
0
votes
1 answer

What changes need to be done to get HTTP Status code of domain using Scrapy?

I have this code available from my previous experiment. import scrapy class BlogSpider(scrapy.Spider): name = 'blogspider' start_urls = ['http://example.com/'] def parse(self, response): for title in response.css('h2'): …
Jaffer Wilson
  • 7,029
  • 10
  • 62
  • 139
0
votes
1 answer

Rest http code for saved with inactive status

My application needs to save user POST data with inactive status 'true' if one of the validation fails. What should be the http response code if I need to communicate request being saved but with inactive status true?
Sujit
  • 1
0
votes
3 answers

Override http status code from 404 to 200

All pages of my website will be accessible by 2 urls: one is normal english and one - IDN. Example: www.example.com/examplepage пример.рф/примерстраницы On server I just have english files, so I decided to create 2 arrays in…
0
votes
2 answers

Http Status Code For Validation Failure Related To An Item Which Doesn't Exist

If I have a method to create a "car" entity, and as part of that it requires a "manufacturerID" but the manufacturer doesn't exist, what status code should I return? 400 to indicate that the request was invalid or 404 to indicate that something…
0
votes
2 answers

ASP.NET API How to return Post request status with custom message?

I would like to store my Http status and them messages in json file, for example BadRequest status could have 2 different messages: 1. name could not be null , 2. name could not be empty and etc... but unfortunatelly I can't solve it,…
BinaryTie
  • 281
  • 1
  • 21
  • 49
0
votes
0 answers

Slim PHP Framework API - http statuscodes not changing

I have recently started using Slim to make an API but I have been unsuccessful in all my attempts. My main problem is that I am not able to set the HTTP status code using the withStatus method on the Response object. I always receive a 200 OK when I…