Search
 
SCRIPT & CODE EXAMPLE
 

PHP

http status codes

100 Continue
101 Switching Protocols
103 Early Hints
200 OK
201 Created
202 Accepted
203 Non-Authoritative Information
204 No Content
205 Reset Content
206 Partial Content
300 Multiple Choices
301 Moved Permanently
302 Found
303 See Other
304 Not Modified
307 Temporary Redirect
308 Permanent Redirect
400 Bad Request
401 Unauthorized
402 Payment Required
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable
407 Proxy Authentication Required
408 Request Timeout
409 Conflict
410 Gone
411 Length Required
412 Precondition Failed
413 Payload Too Large
414 URI Too Long
415 Unsupported Media Type
416 Range Not Satisfiable
417 Expectation Failed
418 I'm a teapot
422 Unprocessable Entity
425 Too Early
426 Upgrade Required
428 Precondition Required
429 Too Many Requests
431 Request Header Fields Too Large
451 Unavailable For Legal Reasons
500 Internal Server Error
501 Not Implemented
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout
505 HTTP Version Not Supported
506 Variant Also Negotiates
507 Insufficient Storage
508 Loop Detected
510 Not Extended
511 Network Authentication Required
Comment

all http status codes

{
    '100': 'Continue',
    '101': 'Switching Protocols',
    '102': 'Processing',
    '103': 'Early Hints',
    '200': 'OK',
    '201': 'Created',
    '202': 'Accepted',
    '203': 'Non-Authoritative Information',
    '204': 'No Content',
    '205': 'Reset Content',
    '206': 'Partial Content',
    '207': 'Multi-Status',
    '208': 'Already Reported',
    '226': 'IM Used',
    '300': 'Multiple Choices',
    '301': 'Moved Permanently',
    '302': 'Found',
    '303': 'See Other',
    '304': 'Not Modified',
    '305': 'Use Proxy',
    '307': 'Temporary Redirect',
    '308': 'Permanent Redirect',
    '400': 'Bad Request',
    '401': 'Unauthorized',
    '402': 'Payment Required',
    '403': 'Forbidden',
    '404': 'Not Found',
    '405': 'Method Not Allowed',
    '406': 'Not Acceptable',
    '407': 'Proxy Authentication Required',
    '408': 'Request Timeout',
    '409': 'Conflict',
    '410': 'Gone',
    '411': 'Length Required',
    '412': 'Precondition Failed',
    '413': 'Payload Too Large',
    '414': 'URI Too Long',
    '415': 'Unsupported Media Type',
    '416': 'Range Not Satisfiable',
    '417': 'Expectation Failed',
    '418': "I'm a Teapot",
    '421': 'Misdirected Request',
    '422': 'Unprocessable Entity',
    '423': 'Locked',
    '424': 'Failed Dependency',
    '425': 'Too Early',
    '426': 'Upgrade Required',
    '428': 'Precondition Required',
    '429': 'Too Many Requests',
    '431': 'Request Header Fields Too Large',
    '451': 'Unavailable For Legal Reasons',
    '500': 'Internal Server Error',
    '501': 'Not Implemented',
    '502': 'Bad Gateway',
    '503': 'Service Unavailable',
    '504': 'Gateway Timeout',
    '505': 'HTTP Version Not Supported',
    '506': 'Variant Also Negotiates',
    '507': 'Insufficient Storage',
    '508': 'Loop Detected',
    '509': 'Bandwidth Limit Exceeded',
    '510': 'Not Extended',
    '511': 'Network Authentication Required'
  }

//minified
{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}
Comment

http response status codes

HTTP response status codes

HTTP response status codes indicate whether a specific HTTP request has been successfully completed. 
Responses are grouped in five classes:

1. Informational responses (100–199)
2. Successful responses (200–299)
3. Redirects (300–399)
4. Client errors (400–499)
5. Server errors (500–599)

1. Information responses
    a. 100 Continue
    b. 101 Switching Protocol
    c. 102 Processing (WebDAV)
    d. 103 Early Hints

2. Successful responses
    a. 200 OK
    b. 201 Created
    c. 202 Accepted
    d. 203 Non-Authoritative Information
    e. 204 No Content
    f. 205 Reset Content
    g. 206 Partial Content
    h. 207 Multi-Status (WebDAV)
    i. 208 Already Reported (WebDAV)
    j. 226 IM Used (HTTP Delta encoding)

3. Redirection messages
    a. 300 Multiple Choice
    b. 301 Moved Permanently
    c. 302 Found
    d. 303 See Other
    e. 304 Not Modified
    f. 305 Use Proxy
    g. 306 unused
    h. 307 Temporary Redirect
    i. 308 Permanent Redirect

4. Client error responses
    a. 400 Bad Request
    b. 401 Unauthorized
    c. 402 Payment Required 
    d. 403 Forbidden
    e. 404 Not Found
    f. 405 Method Not Allowed
    g. 406 Not Acceptable
    h. 407 Proxy Authentication Required
    i. 408 Request Timeout
    j. 409 Conflict
    k. 410 Gone
    l. 411 Length Required
    m. 412 Precondition Failed
    n. 413 Payload Too Large
    o. 414 URI Too Long
    p. 415 Unsupported Media Type
    q. 416 Range Not Satisfiable
    r. 417 Expectation Failed
    s. 418 I'm a teapot
    t. 421 Misdirected Request
    u. 425 Too Early 
    v. 426 Upgrade Required
    w. 428 Precondition Required
    x. 429 Too Many Requests
    y. 431 Request Header Fields Too Large
    z. 451 Unavailable For Legal Reasons

5. Server error responses
    a. 500 Internal Server Error
    b. 501 Not Implemented
    c. 502 Bad Gateway
    d. 503 Service Unavailable
    e. 504 Gateway Timeout
    f. 505 HTTP Version Not Supported
    g. 506 Variant Also Negotiates
    h. 507 Insufficient Storage (WebDAV)
    i. 508 Loop Detected (WebDAV)
    j. 510 Not Extended
    k. 511 Network Authentication Required
Comment

http status codes

2xx :  SUCCESS 
				200 OK : success 
				201 CREATED : successfully added data 
				204 NO-CONTENT successfully updated or deleted 
            
            3xx : REDIRECTION
            	304 NOT MODIFIED: 

			4xx :  CLIENT SIDE ERROR 
				400 BAD REQUEST : bad data being sent 
                401 UNAUTHORIZED : 
                403 FORBIDDEN :
				404 NOT FOUND : the resource does not exists at that location 
				405 METHOD NOT ALLOWED :
						DELETE /api/spartans -->> 405 error 
				406 NOT ACCEPTABLE
				415 Unsupported Media type
					if you forget to specify the Content-Type
					of Post request body, it will see it as plain text
					and it will throw this error if it does not support
			
			5xx : Server side error 
				500 internal service error 	
				If the server do not have any mapping of the url 
				requested to handle the action -->> 500
                503 SERVICE UNAVAILABLE :
                504 GATEWAY TIMEOUT :
Comment

http_response_code

with a param sets the response code, without gets it.
 //set new response code 404:
  http_response_code(404);
// print out current response code
  var_dump(http_response_code());
Comment

http status code

1xx Informational



100 Continue
101 Switching Protocols
102 Processing (WebDAV)


2xx Success


200 OK
201 Created
202 Accepted
203 Non-Authoritative Information
204 No Content
205 Reset Content
206 Partial Content
207 Multi-Status (WebDAV)
208 Already Reported (WebDAV)
226 IM Used

 
3xx Redirection


300 Multiple Choices
301 Moved Permanently
302 Found
303 See Other
304 Not Modified
305 Use Proxy
306 (Unused)
307 Temporary Redirect
308 Permanent Redirect (experimental)

4xx Client Error

400 Bad Request
401 Unauthorized
402 Payment Required
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable
407 Proxy Authentication Required
408 Request Timeout
409 Conflict
410 Gone
411 Length Required
412 Precondition Failed
413 Request Entity Too Large
414 Request-URI Too Long
415 Unsupported Media Type
416 Requested Range Not Satisfiable
417 Expectation Failed
418 I'm a teapot (RFC 2324)
420 Enhance Your Calm (Twitter)
422 Unprocessable Entity (WebDAV)
423 Locked (WebDAV)
424 Failed Dependency (WebDAV)
425 Reserved for WebDAV
426 Upgrade Required
428 Precondition Required
429 Too Many Requests
431 Request Header Fields Too Large
444 No Response (Nginx)
449 Retry With (Microsoft)
450 Blocked by Windows Parental Controls (Microsoft)
451 Unavailable For Legal Reasons
499 Client Closed Request (Nginx)


5xx Server Error



500 Internal Server Error
501 Not Implemented
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout
505 HTTP Version Not Supported
506 Variant Also Negotiates (Experimental)
507 Insufficient Storage (WebDAV)
508 Loop Detected (WebDAV)
509 Bandwidth Limit Exceeded (Apache)
510 Not Extended
511 Network Authentication Required
598 Network read timeout error
599 Network connect timeout error
Comment

http status codes

{
codes: [
    { status: 100, message: "Continue " },
    { status: 101, message: "Switching Protocols " },
    { status: 102, message: "Processing " },
    { status: 200, message: "OK " },
    { status: 201, message: "Created " },
    { status: 202, message: "Accepted " },
    { status: 203, message: "Non - authoritative Information " },
    { status: 204, message: "No Content " },
    { status: 205, message: "Reset Content " },
    { status: 206, message: "Partial Content " },
    { status: 207, message: "Multi - Status " },
    { status: 208, message: "Already Reported " },
    { status: 226, message: "IM Used " },
    { status: 300, message: "Multiple Choices " },
    { status: 301, message: "Moved Permanently " },
    { status: 302, message: "Found " },
    { status: 303, message: "See Other " },
    { status: 304, message: "Not Modified " },
    { status: 305, message: "Use Proxy " },
    { status: 307, message: "Temporary Redirect " },
    { status: 308, message: "Permanent Redirect " },
    { status: 400, message: "Bad Request " },
    { status: 401, message: "Unauthorized " },
    { status: 402, message: "Payment Required " },
    { status: 403, message: "Forbidden " },
    { status: 404, message: "Not Found " },
    { status: 405, message: "Method Not Allowed " },
    { status: 406, message: "Not Acceptable " },
    { status: 407, message: "Proxy Authentication Required " },
    { status: 408, message: "Request Timeout " },
    { status: 409, message: "Conflict " },
    { status: 410, message: "Gone " },
    { status: 411, message: "Length Required " },
    { status: 412, message: "Precondition Failed " },
    { status: 413, message: "Payload Too Large " },
    { status: 414, message: "Request - URI Too Long " },
    { status: 415, message: "Unsupported Media Type " },
    { status: 416, message: "Requested Range Not Satisfiable " },
    { status: 417, message: "Expectation Failed " },
    { status: 418, message: "I’m a teapot " },
    { status: 421, message: "Misdirected Request " },
    { status: 422, message: "Unprocessable Entity " },
    { status: 423, message: "Locked " },
    { status: 424, message: "Failed Dependency " },
    { status: 426, message: "Upgrade Required " },
    { status: 428, message: "Precondition Required " },
    { status: 429, message: "Too Many Requests " },
    { status: 431, message: "Request Header Fields Too Large " },
    { status: 444, message: "Connection Closed Without Response " },
    { status: 451, message: "Unavailable For Legal Reasons " },
    { status: 499, message: "Client Closed Request " },
    { status: 500, message: "Internal Server Error " },
    { status: 501, message: "Not Implemented " },
    { status: 502, message: "Bad Gateway " },
    { status: 503, message: "Service Unavailable " },
    { status: 504, message: "Gateway Timeout " },
    { status: 505, message: "HTTP Version Not Supported " },
    { status: 506, message: "Variant Also Negotiates " },
    { status: 507, message: "Insufficient Storage " },
    { status: 508, message: "Loop Detected " },
    { status: 510, message: "Not Extended " },
    { status: 511, message: "Network Authentication Required " },
    { status: 599, message: "Network Connect Timeout Error" },
]
}
Comment

http status codes

STATUS_CODES: {
            '100': 'Continue',
            '101': 'Switching Protocols',
            '102': 'Processing',
            '103': 'Early Hints',
            '200': 'OK',
            '201': 'Created',
            '202': 'Accepted',
            '203': 'Non-Authoritative Information',
            '204': 'No Content',
            '205': 'Reset Content',
            '206': 'Partial Content',
            '207': 'Multi-Status',
            '208': 'Already Reported',
            '226': 'IM Used',
            '300': 'Multiple Choices',
            '301': 'Moved Permanently',
            '302': 'Found',
            '303': 'See Other',
            '304': 'Not Modified',
            '305': 'Use Proxy',
            '307': 'Temporary Redirect',
            '308': 'Permanent Redirect',
            '400': 'Bad Request',
            '401': 'Unauthorized',
            '402': 'Payment Required',
            '403': 'Forbidden',
            '404': 'Not Found',
            '405': 'Method Not Allowed',
            '406': 'Not Acceptable',
            '407': 'Proxy Authentication Required',
            '408': 'Request Timeout',
            '409': 'Conflict',
            '410': 'Gone',
            '411': 'Length Required',
            '412': 'Precondition Failed',
            '413': 'Payload Too Large',
            '414': 'URI Too Long',
            '415': 'Unsupported Media Type',
            '416': 'Range Not Satisfiable',
            '417': 'Expectation Failed',
            '418': "I'm a Teapot",
            '421': 'Misdirected Request',
            '422': 'Unprocessable Entity',
            '423': 'Locked',
            '424': 'Failed Dependency',
            '425': 'Too Early',
            '426': 'Upgrade Required',
            '428': 'Precondition Required',
            '429': 'Too Many Requests',
            '431': 'Request Header Fields Too Large',
            '451': 'Unavailable For Legal Reasons',
            '500': 'Internal Server Error',
            '501': 'Not Implemented',
            '502': 'Bad Gateway',
            '503': 'Service Unavailable',
            '504': 'Gateway Timeout',
            '505': 'HTTP Version Not Supported',
            '506': 'Variant Also Negotiates',
            '507': 'Insufficient Storage',
            '508': 'Loop Detected',
            '509': 'Bandwidth Limit Exceeded',
            '510': 'Not Extended',
            '511': 'Network Authentication Required'
          }
Comment

http status codes

1. Informational responses (100–199)
2. Successful responses (200–299)
3. Redirects (300–399)
4. Client errors (400–499)
5. Server errors (500–599)

Client Error Responses:
400 Bad Request
401 Unauthorized
402 Payment Required
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable
407 Proxy Authentication Required
408 Request Timeout
409 Conflict
410 Gone
411 Length Required
412 Precondition Failed
413 Request Entity Too Large
414 Request-URI Too Long
415 Unsupported Media Type
416 Requested Range Not Satisfiable
417 Expectation Failed
Comment

http status codes

GET   : 200 OK - Most of the read actions will be answered with a 200 OK status.
POST  : 201 Created - Signals backend-side resource creation.
PUT   : 200 OK - This is the most appropriate code for most use-cases - returns the updated resource.
DELETE: 204 No Content - It’s better to reduce traffic and simply tell the client the deletion is complete.
Comment

HTTP status codes

//Following are HTTP status codes
100 Continue
101 Switching Protocols
103 Early Hints
200 OK
201 Created
202 Accepted
203 Non-Authoritative Information
204 No Content
205 Reset Content
206 Partial Content
300 Multiple Choices
301 Moved Permanently
302 Found
303 See Other
304 Not Modified
307 Temporary Redirect
308 Permanent Redirect
400 Bad Request
401 Unauthorized
402 Payment Required
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable
407 Proxy Authentication Required
408 Request Timeout
409 Conflict
410 Gone
411 Length Required
412 Precondition Failed
413 Payload Too Large
414 URI Too Long
415 Unsupported Media Type
416 Range Not Satisfiable
417 Expectation Failed
418 I'm a teapot
422 Unprocessable Entity
425 Too Early
426 Upgrade Required
428 Precondition Required
429 Too Many Requests
431 Request Header Fields Too Large
451 Unavailable For Legal Reasons
500 Internal Server Error
501 Not Implemented
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout
505 HTTP Version Not Supported
506 Variant Also Negotiates
507 Insufficient Storage
508 Loop Detected
510 Not Extended
511 Network Authentication Required
Comment

HTTP status code


2xx :  SUCCESS 
				200 OK : success 
				201 CREATED : successfully added data 
				204 NO-CONTENT successfully updated or deleted 
            
            3xx : REDIRECTION
            	304 NOT MODIFIED: 

			4xx :  CLIENT SIDE ERROR 
				400 BAD REQUEST : bad data being sent 
                401 UNAUTHORIZED : 
                403 FORBIDDEN :
				404 NOT FOUND : the resource does not exists at that location 
				405 METHOD NOT ALLOWED :
						DELETE /api/spartans -->> 405 error 
				406 NOT ACCEPTABLE
				415 Unsupported Media type
					if you forget to specify the Content-Type
					of Post request body, it will see it as plain text
					and it will throw this error if it does not support
			
			5xx : Server side error 
				500 internal service error 	
				If the server do not have any mapping of the url 
				requested to handle the action -->> 500
                503 SERVICE UNAVAILABLE :
                504 GATEWAY TIMEOUT :

Comment

PREVIOUS NEXT
Code Example
Php :: php split large text on line breaks into array 
Php :: connect another database in wordpress 
Php :: php pdo error handling 
Php :: laravel 5 use env variable in blade 
Php :: php DateTime comparation 
Php :: yii2 jquery head 
Php :: laravel create request 
Php :: laravel hasMany with join 
Php :: csv utf-8 excel into php 
Php :: Adding JavaScript to a Specific WordPress Post or Page Using Code in the Footer 
Php :: laravel log 
Php :: form validation for file type in codeigniter 
Php :: how to named route resource laravel 
Php :: laravel migration string length 
Php :: cviebrock/eloquent-sluggable 
Php :: give custom field name in laravel form validation error message 
Php :: laravel update from 7 to 8 
Php :: how to show image from php 
Php :: php 8 match 
Php :: phpserver 
Php :: composer remove phpmailer 
Php :: file upload codeigniter 
Php :: How to create and access angular HTTP params in PHP 
Php :: laravel where not equal 
Php :: php array_intersect 
Php :: count_chars (PHP 4, PHP 5, PHP 7, PHP 8) count_chars — Return information about characters used in a string 
Php :: date_default_timezone_set(): timezone id 
Php :: wordpress get category description 
Php :: ubuntu apache php version 
Php :: php.hello 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =