Home > Http Code > Http Error Header

Http Error Header

Contents

Retrieved 16 October 2015. ^ "RFC2616 on status 414". Retrieved 2016-09-01. ^ "Introduction". Slurp BingBot Applebot Windows Mobile Playstation 3 Nintendo Wii Bingbot/2.0 iPhone Samsung Galaxy Tab Nexus 7 Yandex Bot MJ12bot Ahrefs Moz QihooBot Baiduspider HTTP/1.0 HTTP/1.1 See also: Spider Test Tool W3C HTTP Status Codes Gain a Competitive Advantage Today Your top competitors have been investing into their marketing strategy for years. Retrieved 13 February 2016. ^ "300". his comment is here

The only methods that servers are required to support (and therefore that must not return this code) are GET and HEAD. 502 Bad Gateway This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response. 503 Service Unavailable The server is not ready to handle the request. The 202 response is intentionally non-committal. This response code allows the client to place preconditions on the current resource metainformation (header field data) and thus prevent the requested method from being applied to a resource other than the one intended. 10.4.14 413 Request Entity Too Large The server is refusing to process a request because the request entity is larger than the server is willing or able to process. It means that the server would like to shut down this unused connection. https://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html

Http Response Example

Retrieved October 15, 2015. ^ "Error message when you try to log on to Exchange 2007 by using Outlook Web Access: "440 Login Timeout"". It was used in a previous version of the HTTP 1.1 specification. 307 Temporary Redirect Server sent this response to directing client to get requested resource to another URI with same method that used prior request. Note: Some sites issue HTTP 401 when an IP address is banned from the website (usually the website domain) and that specific address is refused permission to access a website. 402 Payment Required Reserved for future use. I'm running this behind the AWS Elastic Loadbalancer and trying the header(':'.$error_code...) method mentioned above is treated as invalid HTTP.

The documentation for the header() function has the right way to implement this if you're still on < php 5.4:

header("HTTP/1.0 404 Not Found");
?> up down 2 yefremov {dot} sasha () gmail {dot} com ¶1 year ago @craig at craigfrancis dot co dot [email protected] wrote the function that replaces the original.

RFC 3229. Enter a competing URL below to quickly gain access to their organic & paid search performance history - for free. Since HTTP/1.0 did not define any 1xx status codes, servers must not[note 1] send a 1xx response to an HTTP/1.0 client except under experimental conditions.[4] 100 Continue The server has received the request headers and the client should proceed to send the request body (in the case of a request for which a body needs to be sent; for example, a POST request). Http Code 302 The user-agent may update its cached headers for this resource with the new ones. 205 Reset Content This response code is sent after accomplishing request to tell user agent reset document view which sent this request. 206 Partial Content This response code is used because of range header sent by the client to separate download into multiple streams.

The original intention was that this code might be used as part of some form of digital cash or micropayment scheme, but that has not happened, and this code is not usually used. Retrieved 2016-01-09. ^ "Railgun Listener to Origin Error". httpstatus. http://stackoverflow.com/questions/13963932/rest-error-message-in-http-header-or-response-body Retrieved 16 October 2015. ^ alex. "What is the correct HTTP status code to send when a site is down for maintenance?".

part of Hypertext Transfer Protocol -- HTTP/1.1 RFC 2616 Fielding, et al. 10 Status Code Definitions Each Status-Code is described below, including a description of which method(s) it can follow and any metainformation required in the response. 10.1 Informational 1xx This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line. Http 422 The new URI is not a substitute reference for the originally requested resource. Even if they won't break, they won't care about your special name for specific error code. In some cases, this may even be preferable to sending a 406 response.

Http 418

The response MUST include a WWW-Authenticate header field (section 14.47) containing a challenge applicable to the requested resource. https://developer.mozilla.org/en-US/docs/Web/HTTP/Status These codes are fully defined in section 10. Http Response Example Stack Overflow. Http Status Codes Cheat Sheet Docs.cpanel.net.

https://tools.ietf.org/html/rfc2324. ^ Barry Schwartz (26 August 2014). "New Google Easter Egg For SEO Geeks: Server Status 418, I'm A Teapot". this content About MDN Terms Privacy Cookies Contribute to the code Other languages: English (US) (en-US) 日本語 (ja) 한국어 (ko) Русский (ru) 中文 (简体) (zh-CN) 正體中文 (繁體) (zh-TW) Go Downloads Documentation Get Involved Help PHP 5.6.27 Released Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Errors Exceptions Generators References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Context options and parameters Supported Protocols and Wrappers Security Introduction General considerations Installed as CGI binary Installed as an Apache module Session Security Filesystem Security Database Security Error Reporting Using Register Globals User Submitted Data Magic Quotes Hiding PHP Keeping Current Features HTTP authentication with PHP Cookies Sessions Dealing with XForms Handling file uploads Using remote files Connection handling Persistent Database Connections Safe Mode Command line usage Garbage Collection DTrace Dynamic Tracing Function Reference Affecting PHP's Behaviour Audio Formats Manipulation Authentication Services Command Line Specific Extensions Compression and Archive Extensions Credit Card Processing Cryptography Extensions Database Extensions Date and Time Related Extensions File System Related Extensions Human Language and Character Encoding Support Image Processing and Generation Mail Related Extensions Mathematical Extensions Non-Text MIME Output Process Control Extensions Other Basic Extensions Other Services Search Engine Extensions Server Specific Extensions Session Extensions Text Processing Variable and Type Related Extensions Web Services Windows Only Extensions XML Manipulation Keyboard Shortcuts? Retrieved 16 October 2015. ^ "Mozilla Bugzilla Bug 187996: Strange behavior on 305 redirect". For example, this code could be used to present multiple video format options, to list files with different extensions, or to suggest word sense disambiguation.[19] 301 Moved Permanently This and all future requests should be directed to the given URI.[20] 302 Found This is an example of industry practice contradicting the standard. Http Code 403

The request MUST have included a Range header field (section 14.35) indicating the desired range, and MAY have included an If-Range header field (section 14.27) to make the request conditional. Internet Engineering Task Force. This response is used much more since some browsers, like Chrome or IE9, use HTTP preconnection mechanisms to speed up surfing (see bug 881804, which tracks the future implementation of such a mechanism in Firefox). http://orgias.org/http-code/http-header-error-codes.html Previously called "Request Entity Too Large".[44] 414 URI Too Long (RFC 7231) The URI provided was too long for the server to process.

Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0). Http 404 Retrieved 2015-04-06. ^ "E Explanation of Failure Codes". If you need feedback or have any burning questions please ask in the community forum so we can get them sorted out.

share|improve this answer answered Dec 20 '12 at 1:31 Tadeck 60.9k1293150 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service.

If the 401 response contains the same challenge as the prior response, and the user agent has already attempted authentication at least once, then the user SHOULD be presented the entity that was given in the response, since that entity might include relevant diagnostic information. Many of these status codes are used in URL redirection.[2] A user agent may carry out the additional action with no user interaction only if the method used in the second request is GET or HEAD. httpstatus. Http 502 nginx 1.9.5 source code.

Its purpose is to allow a server to accept a request for some other process (perhaps a batch-oriented process that is only run once per day) without requiring that the user agent's connection to the server persist until the process is completed. Retrieved October 24, 2009. ^ ikitommi; Daraen. "metosin/ring-http-response". These response codes are applicable to any request method.[57] 500 Internal Server Error A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.[58] 501 Not Implemented The server either does not recognize the request method, or it lacks the ability to fulfill the request. http://orgias.org/http-code/http-402-error.html The RFC specifies this code should be returned by teapots requested to brew coffee.[50] This HTTP status is used as an easter egg in some websites, including Google.com.[51] 421 Misdirected Request (RFC 7540) The request was directed at a server that is not able to produce a response (for example because a connection reuse).[52] 422 Unprocessable Entity (WebDAV; RFC 4918) The request was well-formed but was unable to be followed due to semantic errors.[15] 423 Locked (WebDAV; RFC 4918) The resource that is being accessed is locked.[15] 424 Failed Dependency (WebDAV; RFC 4918) The request failed due to failure of a previous request (e.g., a PROPPATCH).[15] 426 Upgrade Required The client should switch to a different protocol such as TLS/1.0, given in the Upgrade header field.[53] 428 Precondition Required (RFC 6585) The origin server requires the request to be conditional.

IETF. If the client is a user agent, it SHOULD NOT change its document view from that which caused the request to be sent. Retrieved January 8, 2015. ^ "Ms-oxdisco". Retrieved 16 October 2015. ^ Brown, Kevin; CRS... "getting 304 response even with django-cors-headers".

Also note that some servers merely shut down the connection without sending this message. 409 Conflict This response would be sent when a request conflict with current state of server. 410 Gone This response would be sent when requested content has been deleted from server. 411 Length Required Server rejected the request because the Content-Length header field is not defined and the server requires it. 412 Precondition Failed The client has indicated preconditions in its headers which the server does not meet. 413 Payload Too Large Request entity is larger than limits defined by server; the server might close the connection or return an Retry-After header field. 414 URI Too Long The URI requested by the client is longer than the server is willing to interpret. 415 Unsupported Media Type The media format of the requested data is not supported by the server, so the server is rejecting the request. 416 Requested Range Not Satisfiable The range specified by the Range header field in the request can't be fulfilled; it's possible that the range is outside the size of the target URI's data. 417 Expectation Failed This response code means the expectation indicated by the Expect request header field can't be met by the server. 421 Misdirected Request The request was directed at a server that is not able to produce a response. IETF. Includes information about web analytics. more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Retrieved 16 October 2015. ^ a b c d e Dusseault, Lisa, ed. (June 2007). Risk-free: Free trial & low monthly price. Cloudflare. I don't think there is a way to return the current status code:

https://bugs.php.net/bug.php?id=52555

For reference the error codes I got from PHP's source code:

http://lxr.php.net/opengrok/xref/PHP_5_4/sapi/cgi/cgi_main.c#354

And how the current http header is sent, with the variables it uses:

http://lxr.php.net/opengrok/xref/PHP_5_4/main/SAPI.c#856 up down 22 Stefan W ¶2 years ago Note that you can NOT set arbitrary response codes with this function, only those that are known to PHP (or the SAPI PHP is running on).

The following codes currently work as expected (with PHP running as Apache module):
200 – 208, 226
300 – 305, 307, 308
400 – 417, 422 – 424, 426, 428 – 429, 431
500 – 508, 510 – 511

Codes 0, 100, 101, and 102 will be sent as "200 OK".

Everything else will result in "500 Internal Server Error".

If you want to send responses with a freestyle status line, you need to use the `header()` function:

("HTTP/1.0 418 I'm A Teapot"); ?> up down 6 Steven ¶1 year ago http_response_code is basically a shorthand way of writing a http status header, with the added bonus that PHP will work out a suitable Reason Phrase to provide by matching your response code to one of the values in an enumeration it maintains within php-src/main/http_status_codes.h.

https://tools.ietf.org/html/rfc2774. Sending a large request body to a server after a request has been rejected for inappropriate headers would be inefficient. Overview Overview of site contents. The entity format is specified by the media type given in the Content- Type header field.

The last two digits do not have any categorization role. If the client continues sending data to the server after the close, the server's TCP stack will send a reset packet to the client, which may erase the client's unacknowledged input buffers before they can be read and interpreted by the HTTP application. 10.4.1 400 Bad Request The request could not be understood by the server due to malformed syntax. the user does not have the necessary credentials. It states: The redirection happens as a "302 Moved" header unless otherwise specified.".

Many HTTP clients (such as Mozilla[26] and Internet Explorer) do not correctly handle responses with this status code, primarily for security reasons.[27] 306 Switch Proxy No longer used. Tracking Learn how to track your success with organic SEO and PPC ads. This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line. Both of these values will default to a 200 status code if used in a web server environment.