Quick reference for HTTPPost()
, HTTPPut()
, and HTTPGet()
errors
2XX Success Messages
This class of code indicates a Success message.
200 OK
Standard response for successful HTTP requests. The actual response will depend on the request method (see https://en.wikipedia.org/wiki/HTTP#Request_methods ) used. In a GET request, the response will contain an entity corresponding to the requested resource. In a POST request, the response will contain an entity describing or containing the result of the action.
201 Created
The request has been fulfilled, resulting in the creation of a new resource.
202 Accepted
The request has been accepted for processing, but the processing has not been completed. The request may or may not be eventually acted upon, and might be disallowed when processing occurs.
3XX Redirection Messages
This class of return indicates the transaction needs to be, or is being, redirected.
300 Multiple Choices
Indicates multiple options for the resource from which the client may choose (via agent-driven content negotiation).
301 Moved Permanently
This and all future requests should be directed to the given URI.
302 Found (Previously "Moved temporarily")
Tells the client to look at (browse to) another URL. The HTTP/1.0 specification required the client to perform a temporary redirect with the same method (the original describing phrase was "Moved Temporarily"), but popular browsers implemented 302 redirects by changing the method to GET. Therefore, HTTP/1.1 added status codes 303 and 307 to distinguish between the two behaviors.
A 302 can indicate cookies need to be used in authentication with the server. *This is not supported by Campbell Scientific data loggers.
4XX Client Side Error Messages
This class of status code is intended for situations in which the error seems to have been caused by the client. Except when responding to a HEAD request, the server should include an entity containing an explanation of the error situation, and whether it is a temporary or permanent condition.
400 Bad Request
The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, size too large, invalid request message framing, or deceptive request routing).
401 Unauthorized
Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not been provided. The response must include a WWW-Authenticate header field containing a challenge applicable to the requested resource. This could be with either Basic or Digest Authentication. 401 semantically means "unauthenticated", meaning the user does not have valid authentication credentials for the target resource.
403 Forbidden
The request contained valid data and was understood by the server, but the server is refusing action. This may be due to the user not having the necessary permissions for a resource, needing an account of some sort, or attempting a prohibited action (e.g. creating a duplicate record where only one is allowed). This code is also typically used if the request provided authentication by answering the WWW-Authenticate header field challenge, but the server did not accept that authentication. The request should not be repeated.
404 Not Found
The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible.
405 Method Not Allowed
A request method is not supported for the requested resource; for example, a GET request on a form that requires data to be presented via POST, or a PUT request on a read-only resource.
406 Not Acceptable
The requested resource is capable of generating only content not acceptable, according to the Accept headers sent in the request.
407 Proxy Authentication Required
The client must first authenticate itself with the proxy.
408 Request Timeout
The server timed out waiting for the request. According to HTTP specifications, "The client did not produce a request within the time the server was prepared to wait. The client MAY repeat the request without modifications at any later time."
409 Conflict
Indicates the request could not be processed because of conflict in the current state of the resource, such as an edit conflict between multiple simultaneous updates.
410 Gone
Indicates the resource requested was previously in use, but it is no longer available and will not be available again. This should be used when a resource has been intentionally removed, and the resource should be purged. Upon receiving a 410 status code, the client should not request the resource in the future. Clients, such as search engines, should remove the resource from their indices. Most use cases do not require clients and search engines to purge the resource, and a "404 Not Found" may be used instead.
411 Length Required
The request did not specify the length of its content, which is required by the requested resource.
412 Precondition Failed
The server does not meet one of the preconditions the requester put on the request header fields.
413 Payload Too Large
The request is larger than the server is willing or able to process. Previously called "Request Entity Too Large".
414 URI Too Long
The URI provided was too long for the server to process. This is often the result of too much data being encoded as a query-string of a GET request, in which case it should be converted to a POST request. Previously called "Request-URI Too Long".
415 Unsupported Media Type
The request entity has a media type that the server or resource does not support. For example, the client uploads an image as image/svg+xml, but the server requires images use a different format.
416 Range Not Satisfiable
The client has asked for a portion of the file (byte serving), but the server cannot supply that portion. For example, if the client asked for a part of the file that lies beyond the end of the file. Previously called "Requested Range Not Satisfiable".
417 Expectation Failed
The server cannot meet the requirements of the Expect request-header field.
421 Misdirected Request
The request was directed at a server that is not able to produce a response (for example, a connection reuse).
422 Unprocessable Content
The request was well-formed (i.e., syntactically correct) but could not be processed.
423 Locked (WebDAV; RFC 4918)
The resource being accessed is locked.
424 Failed Dependency (WebDAV; RFC 4918)
The request failed because it depended on another request and that request failed (e.g., a PROPPATCH).
425 Too Early (RFC 8470)
Indicates the server is unwilling to risk processing a request that might be replayed.
426 Upgrade Required
The client should switch to a different protocol, such as TLS/1.3, in the Upgrade header field.
428 Precondition Required (RFC 6585)
The origin server requires the request to be conditional. Intended to prevent the 'lost update' problem, where a client GETs a resource's state, modifies it, and PUTs it back to the server, but a third party has also modified the state on the server, and results in a conflict.
429 Too Many Requests (RFC 6585)
The user has sent too many requests in a given amount of time. Intended for use with rate-limiting schemes.
431 Request Header Fields Too Large (RFC 6585)
The server is unwilling to process the request because an individual header field, or all the header fields collectively, is too large.
Modified from Wikipedia: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes .