AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Enumerations | Functions
alexaClientSDK::avsCommon::utils::http Namespace Reference

Enumerations

enum  HTTPResponseCode {
  HTTP_RESPONSE_CODE_UNDEFINED = 0, SUCCESS_OK = 200, SUCCESS_CREATED = 201, SUCCESS_ACCEPTED = 202,
  SUCCESS_NO_CONTENT = 204, SUCCESS_PARTIAL_CONTENT = 206, REDIRECTION_MULTIPLE_CHOICES = 300, REDIRECTION_MOVED_PERMANENTLY = 301,
  REDIRECTION_FOUND = 302, REDIRECTION_SEE_ANOTHER = 303, REDIRECTION_TEMPORARY_REDIRECT = 307, REDIRECTION_PERMANENT_REDIRECT = 308,
  CLIENT_ERROR_BAD_REQUEST = 400, CLIENT_ERROR_FORBIDDEN = 403, CLIENT_ERROR_THROTTLING_EXCEPTION = 429, SERVER_ERROR_INTERNAL = 500,
  SERVER_ERROR_NOT_IMPLEMENTED = 501, SERVER_UNAVAILABLE = 503, SUCCESS_START_CODE = SUCCESS_OK, SUCCESS_END_CODE = 299,
  REDIRECTION_START_CODE = REDIRECTION_MULTIPLE_CHOICES, REDIRECTION_END_CODE = REDIRECTION_PERMANENT_REDIRECT
}
 

Functions

bool isStatusCodeSuccess (HTTPResponseCode code)
 
bool isRedirect (HTTPResponseCode code)
 
HTTPResponseCode intToHTTPResponseCode (int code)
 
int responseCodeToInt (HTTPResponseCode responseCode)
 
std::string responseCodeToString (HTTPResponseCode responseCode)
 
std::ostream & operator<< (std::ostream &os, const HTTPResponseCode &code)
 

Enumeration Type Documentation

◆ HTTPResponseCode

Enumerator
HTTP_RESPONSE_CODE_UNDEFINED 

No HTTP response received.

SUCCESS_OK 

HTTP Success with response payload.

SUCCESS_CREATED 

HTTP Success with new resource created.

SUCCESS_ACCEPTED 
SUCCESS_NO_CONTENT 

HTTP Success with no response payload.

SUCCESS_PARTIAL_CONTENT 

HTTP Success with partial content.

REDIRECTION_MULTIPLE_CHOICES 

Multiple redirection choices.

REDIRECTION_MOVED_PERMANENTLY 

Content moved permanently.

REDIRECTION_FOUND 

Content found on another URI.

REDIRECTION_SEE_ANOTHER 

See another - Should issue a GET to the other URI and assume that data was received on this request.

REDIRECTION_TEMPORARY_REDIRECT 

Content can be found on another URI, but the redirect should not be cached - cannot change HTTP method.

REDIRECTION_PERMANENT_REDIRECT 

Content can be found on another URI, and the redirect should be cached - cannot change HTTP method.

CLIENT_ERROR_BAD_REQUEST 

HTTP code for invalid request by user.

CLIENT_ERROR_FORBIDDEN 

HTTP code for forbidden request by user.

CLIENT_ERROR_THROTTLING_EXCEPTION 

HTTP code for too many requests to the service.

SERVER_ERROR_INTERNAL 

HTTP code for internal error by server which didn't fulfill the request.

SERVER_ERROR_NOT_IMPLEMENTED 

HTTP code for internal error by server for not supporting the facility requested.

SERVER_UNAVAILABLE 

HTTP code for service not available.

SUCCESS_START_CODE 

First success code.

SUCCESS_END_CODE 

Last success code.

REDIRECTION_START_CODE 

First code in redirection range.

REDIRECTION_END_CODE 

Last code in redirection range.

Function Documentation

◆ intToHTTPResponseCode()

HTTPResponseCode alexaClientSDK::avsCommon::utils::http::intToHTTPResponseCode ( int  code)
inline

Converts a response code in integer format to an @ HTTPResponseCode enumeration value. Gives an HTTP_RESPONSE_CODE_UNDEFINED if the response code is not mapped by any enumeration value.

Parameters
codeThe response code.
Returns
The enumeration value.

◆ isRedirect()

bool alexaClientSDK::avsCommon::utils::http::isRedirect ( HTTPResponseCode  code)
inline

Checks if the status code is on the HTTP redirect range.

Parameters
codeThe status code to check
Returns
true if it is on the redirect range

◆ isStatusCodeSuccess()

bool alexaClientSDK::avsCommon::utils::http::isStatusCodeSuccess ( HTTPResponseCode  code)
inline

Checks if the status code is on the HTTP success range.

Parameters
codeThe status code to check
Returns
true if it is on the success range

◆ operator<<()

std::ostream& alexaClientSDK::avsCommon::utils::http::operator<< ( std::ostream &  os,
const HTTPResponseCode code 
)
inline

Overwrites the << operator for HTTPResponseCode.

Parameters
osThe output stream pointer.
codeThe HTTPResponseCode to write to the output stream.
Returns
The output stream pointer.

◆ responseCodeToInt()

int alexaClientSDK::avsCommon::utils::http::responseCodeToInt ( HTTPResponseCode  responseCode)
inline

Converts a response code enum value to the code in int.

Parameters
responseCodeThe enum value.
Returns
The equivalent int value.

◆ responseCodeToString()

std::string alexaClientSDK::avsCommon::utils::http::responseCodeToString ( HTTPResponseCode  responseCode)
inline

Produces the string representation of a response code value.

Parameters
responseCodeThe enumeration value.
Returns
The string representation.

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0