Go to the documentation of this file.
27 #include <azure/core/_az_cfg_prefix.h>
142 _az_HTTP_RESPONSE_KIND_STATUS_LINE = 0,
143 _az_HTTP_RESPONSE_KIND_HEADER = 1,
144 _az_HTTP_RESPONSE_KIND_BODY = 2,
145 _az_HTTP_RESPONSE_KIND_EOF = 3,
146 } _az_http_response_kind;
165 _az_http_response_kind next_kind;
188 .http_response = buffer,
192 .next_kind = _az_HTTP_RESPONSE_KIND_STATUS_LINE,
270 #include <azure/core/_az_cfg_suffix.h>
@ AZ_HTTP_STATUS_CODE_NOT_ACCEPTABLE
HTTP 406 Not Acceptable.
Definition: az_http.h:73
@ AZ_HTTP_STATUS_CODE_GATEWAY_TIMEOUT
HTTP 504 Gateway Timeout.
Definition: az_http.h:104
Definition of az_result and helper functions.
@ AZ_HTTP_STATUS_CODE_PRECONDITION_REQUIRED
HTTP 428 Precondition Required.
Definition: az_http.h:92
@ AZ_HTTP_STATUS_CODE_UNPROCESSABLE_ENTITY
HTTP 422 Unprocessable Entity.
Definition: az_http.h:87
@ AZ_HTTP_STATUS_CODE_ALREADY_REPORTED
HTTP 208 Already Reported.
Definition: az_http.h:53
az_http_status_code
Defines the possible HTTP status codes.
Definition: az_http.h:33
@ AZ_HTTP_STATUS_CODE_VARIANT_ALSO_NEGOTIATES
HTTP 506 Variant Also Negotiates.
Definition: az_http.h:106
@ AZ_HTTP_STATUS_CODE_IM_USED
HTTP 226 IM Used.
Definition: az_http.h:54
@ AZ_HTTP_STATUS_CODE_MULTI_STATUS
HTTP 207 Multi-Status.
Definition: az_http.h:52
@ AZ_HTTP_STATUS_CODE_PARTIAL_CONTENT
HTTP 206 Partial Content.
Definition: az_http.h:51
@ AZ_HTTP_STATUS_CODE_URI_TOO_LONG
HTTP 414 URI Too Long.
Definition: az_http.h:82
az_result
The type represents the various success and error conditions.
Definition: az_result.h:53
@ AZ_HTTP_STATUS_CODE_REQUEST_HEADER_FIELDS_TOO_LARGE
HTTP 431 Request Header Fields Too Large.
Definition: az_http.h:94
@ AZ_HTTP_STATUS_CODE_NO_CONTENT
HTTP 204 No Content.
Definition: az_http.h:49
@ AZ_HTTP_STATUS_CODE_UPGRADE_REQUIRED
HTTP 426 Upgrade Required.
Definition: az_http.h:91
@ AZ_HTTP_STATUS_CODE_MOVED_PERMANENTLY
HTTP 301 Moved Permanently.
Definition: az_http.h:58
@ AZ_HTTP_STATUS_CODE_FAILED_DEPENDENCY
HTTP 424 Failed Dependency.
Definition: az_http.h:89
@ AZ_HTTP_STATUS_CODE_PAYMENT_REQUIRED
HTTP 402 Payment Required.
Definition: az_http.h:69
@ AZ_HTTP_STATUS_CODE_MISDIRECTED_REQUEST
HTTP 421 Misdirected Request.
Definition: az_http.h:86
@ AZ_HTTP_STATUS_CODE_HTTP_VERSION_NOT_SUPPORTED
HTTP 505 HTTP Version Not Supported.
Definition: az_http.h:105
@ AZ_HTTP_STATUS_CODE_UNSUPPORTED_MEDIA_TYPE
HTTP 415 Unsupported Media Type.
Definition: az_http.h:83
@ AZ_HTTP_STATUS_CODE_PAYLOAD_TOO_LARGE
HTTP 413 Payload Too Large.
Definition: az_http.h:81
#define AZ_SPAN_EMPTY
An empty az_span.
Definition: az_span.h:84
@ AZ_HTTP_STATUS_CODE_FORBIDDEN
HTTP 403 Forbidden.
Definition: az_http.h:70
int32_t retry_delay_msec
The minimum time, in milliseconds, to wait before a retry.
Definition: az_http.h:131
int32_t max_retry_delay_msec
The maximum time, in milliseconds, to wait before a retry.
Definition: az_http.h:134
@ AZ_HTTP_STATUS_CODE_FOUND
HTTP 302 Found.
Definition: az_http.h:59
@ AZ_HTTP_STATUS_CODE_CONFLICT
HTTP 409 Conflict.
Definition: az_http.h:77
@ AZ_HTTP_STATUS_CODE_TOO_EARLY
HTTP 425 Too Early.
Definition: az_http.h:90
@ AZ_HTTP_STATUS_CODE_NETWORK_AUTHENTICATION_REQUIRED
HTTP 511 Network Authentication Required.
Definition: az_http.h:110
@ AZ_HTTP_STATUS_CODE_CONTINUE
HTTP 100 Continue.
Definition: az_http.h:38
@ AZ_HTTP_STATUS_CODE_NOT_MODIFIED
HTTP 304 Not Modified.
Definition: az_http.h:61
Context for canceling long running operations.
@ AZ_HTTP_STATUS_CODE_LOOP_DETECTED
HTTP 508 Loop Detected.
Definition: az_http.h:108
@ AZ_HTTP_STATUS_CODE_NOT_FOUND
HTTP 404 Not Found.
Definition: az_http.h:71
@ AZ_HTTP_STATUS_CODE_OK
HTTP 200 OK.
Definition: az_http.h:44
Allows you to customize the retry policy used by SDK clients whenever they perform an I/O operation.
Definition: az_http.h:126
@ AZ_HTTP_STATUS_CODE_SERVICE_UNAVAILABLE
HTTP 503 Unavailable.
Definition: az_http.h:103
@ AZ_HTTP_STATUS_CODE_PRECONDITION_FAILED
HTTP 412 Precondition Failed.
Definition: az_http.h:80
@ AZ_HTTP_STATUS_CODE_BAD_REQUEST
HTTP 400 Bad Request.
Definition: az_http.h:67
@ AZ_HTTP_STATUS_CODE_ACCEPTED
HTTP 202 Accepted.
Definition: az_http.h:46
@ AZ_HTTP_STATUS_CODE_USE_PROXY
HTTP 305 Use Proxy.
Definition: az_http.h:62
@ AZ_HTTP_STATUS_CODE_NON_AUTHORITATIVE_INFORMATION
HTTP 203 Non-Authoritative Information.
Definition: az_http.h:47
An az_span represents a contiguous byte buffer and is used for string manipulations,...
@ AZ_HTTP_STATUS_CODE_PROCESSING
HTTP 102 Processing.
Definition: az_http.h:40
@ AZ_HTTP_STATUS_CODE_GONE
HTTP 410 Gone.
Definition: az_http.h:78
@ AZ_HTTP_STATUS_CODE_LENGTH_REQUIRED
HTTP 411 Length Required.
Definition: az_http.h:79
@ AZ_HTTP_STATUS_CODE_RESET_CONTENT
HTTP 205 Rest Content.
Definition: az_http.h:50
@ AZ_HTTP_STATUS_CODE_MULTIPLE_CHOICES
HTTP 300 Multiple Choices.
Definition: az_http.h:57
AZ_NODISCARD az_result az_http_response_get_status_line(az_http_response *ref_response, az_http_response_status_line *out_status_line)
Returns the az_http_response_status_line information within an HTTP response.
uint8_t major_version
HTTP Major Version.
Definition: az_http.h:211
@ AZ_HTTP_STATUS_CODE_PROXY_AUTHENTICATION_REQUIRED
HTTP 407 Proxy Authentication Required.
Definition: az_http.h:74
@ AZ_HTTP_STATUS_CODE_METHOD_NOT_ALLOWED
HTTP 405 Method Not Allowed.
Definition: az_http.h:72
AZ_NODISCARD az_result az_http_response_get_body(az_http_response *ref_response, az_span *out_body)
Returns a span over the HTTP body within an HTTP response.
@ AZ_HTTP_STATUS_CODE_SWITCHING_PROTOCOLS
HTTP 101 Switching Protocols.
Definition: az_http.h:39
@ AZ_HTTP_STATUS_CODE_TEMPORARY_REDIRECT
HTTP 307 Temporary Redirect.
Definition: az_http.h:63
@ AZ_HTTP_STATUS_CODE_EXPECTATION_FAILED
HTTP 417 Expectation Failed.
Definition: az_http.h:85
AZ_NODISCARD AZ_INLINE az_result az_http_response_init(az_http_response *out_response, az_span buffer)
Initializes an az_http_response instance over a byte buffer (span) which will be filled with the HTTP...
Definition: az_http.h:184
@ AZ_HTTP_STATUS_CODE_UNAUTHORIZED
HTTP 401 Unauthorized.
Definition: az_http.h:68
az_http_status_code status_code
Status Code.
Definition: az_http.h:210
@ AZ_HTTP_STATUS_CODE_NONE
No HTTP status code.
Definition: az_http.h:35
@ AZ_HTTP_STATUS_CODE_RANGE_NOT_SATISFIABLE
HTTP 416 Range Not Satisfiable.
Definition: az_http.h:84
@ AZ_HTTP_STATUS_CODE_SEE_OTHER
HTTP 303 See Other.
Definition: az_http.h:60
@ AZ_HTTP_STATUS_CODE_BAD_GATEWAY
HTTP 502 Bad Gateway.
Definition: az_http.h:102
@ AZ_HTTP_STATUS_CODE_LOCKED
HTTP 423 Locked.
Definition: az_http.h:88
@ AZ_HTTP_STATUS_CODE_INTERNAL_SERVER_ERROR
HTTP 500 Internal Server Error.
Definition: az_http.h:100
Represents the result of making an HTTP request. An application obtains this initialized structure by...
Definition: az_http.h:208
@ AZ_HTTP_STATUS_CODE_NOT_EXTENDED
HTTP 510 Not Extended.
Definition: az_http.h:109
@ AZ_HTTP_STATUS_CODE_REQUEST_TIMEOUT
HTTP 408 Request Timeout.
Definition: az_http.h:76
@ AZ_HTTP_STATUS_CODE_TOO_MANY_REQUESTS
HTTP 429 Too Many Requests.
Definition: az_http.h:93
@ AZ_HTTP_STATUS_CODE_NOT_IMPLEMENTED
HTTP 501 Not Implemented.
Definition: az_http.h:101
az_span reason_phrase
Reason Phrase.
Definition: az_http.h:209
uint8_t minor_version
HTTP Minor Version.
Definition: az_http.h:212
az_http_status_code const * status_codes
An array of HTTP status codes to retry on, terminated by AZ_HTTP_STATUS_CODE_END_OF_LIST.
Definition: az_http.h:128
@ AZ_HTTP_STATUS_CODE_EARLY_HINTS
HTTP 103 Early Hints.
Definition: az_http.h:41
Configurable constants used by the Azure SDK.
@ AZ_HTTP_STATUS_CODE_UNAVAILABLE_FOR_LEGAL_REASONS
HTTP 451 Unavailable For Legal Reasons.
Definition: az_http.h:96
AZ_NODISCARD az_result az_http_response_get_next_header(az_http_response *ref_response, az_span *out_name, az_span *out_value)
Returns the next HTTP response header.
@ AZ_HTTP_STATUS_CODE_PERMANENT_REDIRECT
HTTP 308 Permanent Redirect.
Definition: az_http.h:64
Allows you to parse an HTTP response's status line, headers, and body.
Definition: az_http.h:157
Represents a "view" over a byte buffer that represents a contiguous region of memory....
Definition: az_span.h:33
@ AZ_HTTP_STATUS_CODE_END_OF_LIST
Used in az_http_policy_retry_options to indicate the end of the list.
Definition: az_http.h:114
@ AZ_OK
Success.
Definition: az_result.h:56
int32_t max_retries
Maximum number of retries.
Definition: az_http.h:137
@ AZ_HTTP_STATUS_CODE_INSUFFICIENT_STORAGE
HTTP 507 Insufficient Storage.
Definition: az_http.h:107
@ AZ_HTTP_STATUS_CODE_CREATED
HTTP 201 Created.
Definition: az_http.h:45