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

Swagger UI shows a wrong status code for a JAX-RS resource

I have a very simple delete method: /** * Delete the question with the specified id * * @return a 204 NO CONTENT on success or a 404 NOT FOUND if there is no question available * @successResponse 204 The question was…
McPringle
  • 1,939
  • 2
  • 16
  • 19
0
votes
1 answer

Testing: check that all resources are loaded

In the context of BDD and php, I've been looking for a way to check that all resources on a page are loaded. I thought about using the status code but it looks like the only status code I can check using mink is the status code of the page itself…
Hub 20xx
  • 401
  • 5
  • 14
0
votes
2 answers

Redirect to an URL from httpwebresponse Location header

Im trying to redirect my ASP.NET page on it load to redirect to another page, whose URL i would get from the response of an HTTP post. HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url); StringBuilder postData = new…
Raju
  • 207
  • 4
  • 12
0
votes
2 answers

My client queries my server. If the response is negative (e.g. error) how should I communicate it?

Should I rely on http status codes? Or should I use some kind of special response? My server is running PHP and producing simple JSON responses.
gurghet
  • 7,591
  • 4
  • 36
  • 63
0
votes
2 answers

Get HTTP Response Status Code

I'm using python and scapy to send HTTP request to a specific URL address. After sending it, I want to read the response status code (200, 401, 404, etc.). I used this method: >>> syn = IP(dst='www.google.com') / TCP(dport=80, flags='S') >>> syn_ack…
Nick
  • 499
  • 4
  • 11
  • 25
0
votes
0 answers

express returning 201 instead of 200

I have a simple express route that GETs a user from mongo routes.js router.get('/users/:username', userController.read); user.controller.js function read(req, res) { User.findOne({ username: req.params.username }, function(err,…
Yoni Levy
  • 1,562
  • 2
  • 16
  • 35
0
votes
1 answer

426 Status: WebSockets with Node.js

Im currently switching my application from using Socket.io to HTML5 WebSockets. I'm assuming that my problem lies within the first couple lines of both the client and server. My browser keeps on replying with a 426 (Upgrade Required) status when I…
Pazuzu
  • 301
  • 2
  • 13
0
votes
1 answer

HTTP status code 0 is maybe Cross-site scripting?

I have a $.ajax that run file in php and pass a variable (email andress). The file works very good but the xhr.status is 0. This is the code: $.ajax({ type: 'POST', url: 'file.php', data: { email: destinatario…
Borja
  • 3,359
  • 7
  • 33
  • 66
0
votes
1 answer

run function if success ($.ajax) has 200 status code?

I would like to use success and run function only if has 200 status code I have see only this example: $.ajax ({ success: function(data,textStatus,jqXHR){ external(); } )}; But i never see a really code example i would like the if…
Borja
  • 3,359
  • 7
  • 33
  • 66
0
votes
1 answer

HTTP: Proper Response for Downstream Request Failing

Say I have service http://myservice.dev:8080/resource/get/id which calls another service http://otherservice.dev:8080/resource/get/name. If the second service does not respond because it is down, what is the proper response the calling service…
Matt
  • 5,408
  • 14
  • 52
  • 79
0
votes
0 answers

Which status code return when user is authenticated but not authorizated?

On the system exists two types of user: teachers and students. Rule: Only teachers can create projects by accessing /new/project. When this occurs, the status code of response is 200. Problem: In a REST scenerios, if students try to access the…
Alexandre Thebaldi
  • 4,546
  • 6
  • 41
  • 55
0
votes
2 answers

401 error code interpreted incorrectly in angular

I am relatively new to angular so I am not sure if I am missing something here. I have an Http Interceptor for adding JWT tokens to requests as well as handling responses from the server. .factory('myHttpInterceptor', ['$q', '$location', '$window',…
DanielRSA
  • 15
  • 1
  • 3
0
votes
0 answers

SOAP response status code 500

I've tried to connect to a SOAP API from a iOS application in objective c, xcode. First, i used a wsdl2objc to produce endpoint stubs for the access, but i got response status code 500 like this: { URL: http://api.tradera.com/v3/PublicService.asmx…
user2908112
  • 457
  • 6
  • 18
0
votes
0 answers

Send Exception and Json with spring MVC

I'm trying to manage exceptions in a Spring MVC context and send different http statuses in response. I tried this : @ResponseStatus(value = HttpStatus.SERVICE_UNAVAILABLE) public class UnavailableServiceException extends RuntimeException…
z8manu8z
  • 15
  • 1
  • 6
0
votes
0 answers

What's the most appropriate HTTP status code to return when a client specifies HTTP/1.0 in a websocket opening handshake?

According to the WebSocket RFC (RFC6455#section-4.2.1): If the server, while reading the handshake, finds that the client did not send a handshake that matches the description below [...], the server MUST stop processing the client's handshake and…
Will
  • 2,014
  • 2
  • 19
  • 42