olp-cpp-sdk  1.19.0
Public Types | Static Public Member Functions | List of all members
olp::http::HttpStatusCode Class Reference

HTTP status codes, as specified in RFC7231. More...

#include <HttpStatusCode.h>

Public Types

enum  : int {
  CONTINUE = 100 , SWITCHING_PROTOCOLS = 101 , PROCESSING = 102 , OK = 200 ,
  CREATED = 201 , ACCEPTED = 202 , NON_AUTHORITATIVE_INFORMATION = 203 , NO_CONTENT = 204 ,
  RESET_CONTENT = 205 , PARTIAL_CONTENT = 206 , MULTI_STATUS = 207 , ALREADY_REPORTED = 208 ,
  IM_USED = 226 , MULTIPLE_CHOICES = 300 , MOVED_PERMANENTLY = 301 , FOUND = 302 ,
  SEE_OTHER = 303 , NOT_MODIFIED = 304 , USE_PROXY = 305 , SWITCH_PROXY = 306 ,
  TEMPORARY_REDIRECT = 307 , PERMANENT_REDIRECT = 308 , BAD_REQUEST = 400 , UNAUTHORIZED = 401 ,
  PAYMENT_REQUIRED = 402 , FORBIDDEN = 403 , NOT_FOUND = 404 , METHOD_NOT_ALLOWED = 405 ,
  NOT_ACCEPTABLE = 406 , PROXY_AUTHENTICATION_REQUIRED = 407 , REQUEST_TIMEOUT = 408 , CONFLICT = 409 ,
  GONE = 410 , LENGTH_REQUIRED = 411 , PRECONDITION_FAILED = 412 , REQUEST_ENTITY_TOO_LARGE = 413 ,
  REQUEST_URI_TOO_LONG = 414 , UNSUPPORTED_MEDIA_TYPE = 415 , REQUESTED_RANGE_NOT_SATISFIABLE = 416 , EXPECTATION_FAILED = 417 ,
  IM_A_TEAPOT = 418 , AUTHENTICATION_TIMEOUT = 419 , METHOD_FAILURE = 420 , UNPROC_ENTITY = 422 ,
  LOCKED = 423 , FAILED_DEPENDENCY = 424 , UPGRADE_REQUIRED = 426 , PRECONDITION_REQUIRED = 427 ,
  TOO_MANY_REQUESTS = 429 , REQUEST_HEADER_FIELDS_TOO_LARGE = 431 , LOGIN_TIMEOUT = 440 , NO_RESPONSE = 444 ,
  RETRY_WITH = 449 , BLOCKED = 450 , REDIRECT = 451 , REQUEST_HEADER_TOO_LARGE = 494 ,
  CERTIFICATE = 495 , NO_CERTIFICATE = 496 , HTTP_TO_HTTPS_PORT = 497 , CLIENT_CLOSED_REQUEST = 499 ,
  INTERNAL_SERVER_ERROR = 500 , NOT_IMPLEMENTED = 501 , BAD_GATEWAY = 502 , SERVICE_UNAVAILABLE = 503 ,
  GATEWAY_TIMEOUT = 504 , VERSION_NOT_SUPPORTED = 505 , VARIANT_ALSO_NEGOTIATES = 506 , INSUFFICIENT_STORAGE = 507 ,
  LOOP_DETECTED = 508 , BANDWIDTH_LIMIT_EXCEEDED = 509 , NOT_EXTENDED = 510 , NETWORK_AUTHENTICATION_REQUIRED = 511 ,
  NETWORK_READ_TIMEOUT = 598 , NETWORK_CONNECT_TIMEOUT = 599
}
 

Static Public Member Functions

static bool IsRetryable (int http_code)
 Checks if the given error code is a temporary error. More...
 
static olp::client::ErrorCode GetErrorCode (int http_code)
 Maps an HTTP status code or olp::http::ErrorCode to olp::client::ErrorCode. More...
 

Detailed Description

HTTP status codes, as specified in RFC7231.

For more information, see the Hypertext Transfer Protocol (HTTP) Status Code Registry.

Member Function Documentation

◆ GetErrorCode()

static olp::client::ErrorCode olp::http::HttpStatusCode::GetErrorCode ( int  http_code)
inlinestatic

Maps an HTTP status code or olp::http::ErrorCode to olp::client::ErrorCode.

Parameters
[in]http_codeThe HTTP status code or olp::http::ErrorCode.
Returns
The corresponding olp::client::ErrorCode.

◆ IsRetryable()

static bool olp::http::HttpStatusCode::IsRetryable ( int  http_code)
inlinestatic

Checks if the given error code is a temporary error.

Some errors are sever errors or caused by wrong user data. These errors cannot be repeated and always result in the same error.

Parameters
[in]http_codeThe HTTP status code or olp::http::ErrorCode.
Returns
True if the request can be repeated; false otherwise.

The documentation for this class was generated from the following file: