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-source flume into hdfs is not working​.? The status code for the post request is 400?

While setting an http-source for a flume agent, i used the port 8989. and the agent starts fine but when i make a post request i get the status_code 400 and on get request status_code is 400. Someone pointed out that i am passing wrong data in the…
irfan aziz
  • 11
  • 4
0
votes
1 answer

Can i just check the domain availability by using the HTTP return status code?

Currently, i have to check domain availability then someone give me an idea that to use the HTTP return status code. If domain is available it will return HTTP 404 otherwise the domain is not available. The question is, Can i just use the HTTP…
0
votes
1 answer
0
votes
1 answer

Python OPTIONS/GET requests

I been stuck on this for past few hours. Can't figure this out. I tested this out on postman and it works fine. But in python, I kept getting 405 requests. Raw API request OPTIONS /sessions HTTP/1.1 Host:…
Av0id
  • 33
  • 11
0
votes
1 answer

Best practices for API response status codes

I am building an API and I am returning this kind of status codes for each method (e.g., "register_user"): 200 (OK) when the user has been registered successfully 403 (forbidden) when there are missing parameters in the request 409 (conflict) when…
user411103
0
votes
1 answer

Which status code to use?

I have script and it sometimes cause 500 Internal Server Error. I can handle that errors. But which status to use in answer when this occur? Code example in perl: # catch error eval { here is code which sometimes cause 500 .... …
Eugen Konkov
  • 22,193
  • 17
  • 108
  • 158
0
votes
1 answer

How do I find out if a server is active or not based on HttpStatus code?

I have a test application that validates URLs to check if a particular service is up. Trouble is, I am validating a range of URLs which will send me a variety of Http Statuses, for eg: 200(OK) is valid and 302(Found) is also valid. But 500 or 404…
Mkl Rjv
  • 6,815
  • 5
  • 29
  • 47
0
votes
1 answer

Is it OK to reuse HTTP status codes like 416?

I want to notify a client of a specific error condition using a HTTP status code. The closest I can come by is "416 Range Not Satisfiable" - although the service has nothing to do with serving byte-ranges from files. Can I liberally interpret the…
aaa90210
  • 11,295
  • 13
  • 51
  • 88
0
votes
0 answers

Strange Status 420 in HttpStatusException - jsoup

I've got strange problem associated with getting HTML Document from URL address. This is code that concerns it. Connection conn = Jsoup.connect(address); conn.timeout(10 * 1000); Connection.Response resp = conn.execute(); if (resp.statusCode() ==…
Sarnapa
  • 1
  • 1
  • 3
0
votes
1 answer

Http Request with Google API client library

I'm using Java in order to get some JSON files from an API (Authorisation required), but I haven't found how the set up the request probably. I'm using the Google API Client Libary…
Werner der Champ
  • 361
  • 1
  • 3
  • 12
0
votes
0 answers

Can Facebook return a https status code different than 200 when requesting user info is successful?

I have created a code that checks if user is logged into Facebook. This is how it looks like: URL url = new URL("https://graph.facebook.com/me?access_token=" + this.fb_token); System.out.println("Attempting to open connection"); HttpsURLConnection…
user6367252
0
votes
0 answers

Get JSON with Http status codes

I'm migrating a project from PHP to Java. I had no problem doing this, but the project contains a HTTP request which I couldn't set up yet. It has to grab a JSON from an API (Authorisation required) and then save it as a variable (which gets passed…
Werner der Champ
  • 361
  • 1
  • 3
  • 12
0
votes
1 answer

Symfony: set cache headers through annotations only for specific status codes

Is there a way to set cache headers in symfony controller annotations only for specific status codes? I am currently doing it like in the code below, utilizing the annotations provided by the SensioFrameworkExtraBundle: /** * @Get("",…
Thomas
  • 385
  • 5
  • 8
0
votes
1 answer

MVC5 return status 500 custom page, tried normal solutions

I want to be able to control a redirect to a different page or return a different view on certain handled errors. I can create custom pages with status 404, 403, 418, and it displays the page fine, but when I try to return 500 it overrides it with…
0
votes
0 answers

Changing status code of invalid URLs hosted in S3 bucket

I'm hosting a static site in AWS S3. I have put a error document in the bucket settings in case the user requests for a object that is not present in S3. I get the error document in such cases, but the status code is still a error code. How can I…