Questions tagged [http-error]

An error code as a result of an HTTP request.

In the HTTP protocol each request returns a result code, also sometimes called HTTP error code. The code is a numeric value describing the result of the requested operation.

Examples:
200 OK, the request was executed without errors.
404 File not found, the requested file couldn't be found.

See the full list here.

726 questions
470
votes
40 answers

HTTP Error 503, the service is unavailable

I'm really new to setting up web servers in general. I've got IIS 8 on Windows 8, and I'm trying to set up a little site locally, while doing some development. In IIS I choose Add Site, give a name, points to a location where I have a index.html…
Andreas
  • 5,501
  • 2
  • 20
  • 23
451
votes
13 answers

How to respond with an HTTP 400 error in a Spring MVC @ResponseBody method returning String

I'm using Spring MVC for a simple JSON API, with @ResponseBody based approach like the following. (I already have a service layer producing JSON directly.) @RequestMapping(value = "/matches/{matchId}", produces =…
Jonik
  • 80,077
  • 70
  • 264
  • 372
174
votes
54 answers

HTTP Error 500.30 - ANCM In-Process Start Failure

I was experimenting with a new feature that comes with .NET core sdk 2.2 that is supposedly meant to improve performance by around 400%. Impressive so I tried it out on my ABP (ASP.NET Boilerplate) project Template asp.net core mvc 4.0.2.0 I added…
jazb
  • 5,498
  • 6
  • 37
  • 44
95
votes
3 answers

Rest error message in HTTP Header or Response Body?

I have a REST service that is exposed to iPhone and Android clients. Currently I follow the HTTP codes 200, 400, 401, 403, 404, 409, 500 etc. My question is where is the recommended place to put the reason/description/cause of the error? Does it…
James Cowhen
  • 2,837
  • 3
  • 24
  • 32
72
votes
3 answers

Overriding urllib2.HTTPError or urllib.error.HTTPError and reading response HTML anyway

I receive a 'HTTP Error 500: Internal Server Error' response, but I still want to read the data inside the error HTML. With Python 2.6, I normally fetch a page using: import urllib2 url = "http://google.com" data = urllib2.urlopen(url) data =…
backus
  • 4,076
  • 5
  • 28
  • 30
63
votes
4 answers

how to get access to error message from abort command when using custom error handler

Using a python flask server, I want to be able to throw an http error response with the abort command and use a custom response string and a custom message in the body @app.errorhandler(400) def custom400(error): response = jsonify({'message':…
richmb
  • 1,495
  • 2
  • 15
  • 20
58
votes
7 answers

Global error handler for any exception

Is there a way to add a global catch-all error handler in which I can change the response to a generic JSON response? I can't use the got_request_exception signal, as it is not allowed to modify the response…
joscarsson
  • 4,789
  • 4
  • 35
  • 43
31
votes
4 answers

Instagram/feed API media URL shows 'URL signature expired'

I am using Instagram feed API to show my Instagram posts on my Website. But some video URL shows 'URL signature expired'. Any solution for me ?
28
votes
1 answer

Need response body of HTTP 500 with file_get_contents (PHP)

Using file_get_contents as part of custom SOAP implementation to apply SOAP calls (ALL libraries that we tried would not do SSL + certificate based authentication with SOAP 1.2 correctly). However difficult and barely-documented API often returns…
frEEk
  • 283
  • 1
  • 3
  • 4
28
votes
3 answers

How to convert ConstraintViolationException 500 error to 400 bad request?

If I use a constraint like this @NotNull and then in the controller public User createUser( @Validated @RequestBody User user) {} It gives a really nice 400 exception with details. But if I use my own custom validator like…
erotsppa
  • 14,248
  • 33
  • 123
  • 181
26
votes
5 answers

urllib2 HTTP Error 400: Bad Request

I have a piece of code like this host = 'http://www.bing.com/search?q=%s&go=&qs=n&sk=&sc=8-13&first=%s' % (query, page) req = urllib2.Request(host) req.add_header('User-Agent', User_Agent) response = urllib2.urlopen(req) and when I input a query…
PyFan
  • 271
  • 1
  • 3
  • 5
24
votes
2 answers

Is HTTP 501 appropriate for an unimplemented API?

Is an HTTP 501 error appropriate for functionality which the server plans to support, but does not currently, such as a particular case of an API? For instance, if I was designing a webmail app and I couldn't yet delete emails with attachments,…
coppro
  • 14,338
  • 5
  • 58
  • 73
24
votes
4 answers

Understanding “408 Request Timeout” on Apache with PHP

Issue description - Apache logs I found items similar to this one in the Apache log file: 166.147.68.243 [24/Feb/2013:06:06:25 -0500] 19 web-site.com "-" 408 - "-" I’ve got custom log format and 408 here stands for status. The log format…
Victor Smirnov
  • 3,450
  • 4
  • 30
  • 49
23
votes
4 answers

How do I display custom error pages in Asp.Net Mvc 3?

I want all 401 errors to be be redirected to a custom error page. I have initially setup the following entry in my web.config.
23
votes
1 answer

400 vs 422 for Client Error Request

I've read a lot of posts and articles regarding proper http status code to return for client request error. Others suggest to use 400 as it has been redefined in RFC 7231 though I'm not sure if the example given covers all the client error in my…
1
2 3
48 49