diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-02-02 12:46:02 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-02-02 12:46:02 -0800 |
| commit | fc0abbdf71700b2414ba012f9863f7dfaf514b91 (patch) | |
| tree | 16fca800dbce3abf42f4013cfb0ca4b8aed3981f /docs/nng_http_res_get_status.adoc | |
| parent | 490bc97dbf76fae2a99c8bacd5fd9be332d68b90 (diff) | |
| download | nng-fc0abbdf71700b2414ba012f9863f7dfaf514b91.tar.gz nng-fc0abbdf71700b2414ba012f9863f7dfaf514b91.tar.bz2 nng-fc0abbdf71700b2414ba012f9863f7dfaf514b91.zip | |
Document HTTP request/reply structures and handling.
Diffstat (limited to 'docs/nng_http_res_get_status.adoc')
| -rw-r--r-- | docs/nng_http_res_get_status.adoc | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/docs/nng_http_res_get_status.adoc b/docs/nng_http_res_get_status.adoc new file mode 100644 index 00000000..5a0db720 --- /dev/null +++ b/docs/nng_http_res_get_status.adoc @@ -0,0 +1,125 @@ += nng_http_res_get_status(3) +:doctype: manpage +:manmanual: nng +:mansource: nng +:manvolnum: 3 +:copyright: Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> \ + Copyright 2018 Capitar IT Group BV <info@capitar.com> \ + This software is supplied under the terms of the MIT License, a \ + copy of which should be located in the distribution where this \ + file was obtained (LICENSE.txt). A copy of the license may also \ + be found online at https://opensource.org/licenses/MIT. + +== NAME + +nng_http_res_get_status - return HTTP status code + +== SYNOPSIS + +[source, c] +----------- +#include <nng/nng.h> + +uint16_t nng_http_res_get_status(nng_http_res *res); +----------- + +== DESCRIPTION + +The `nng_http_res_get_status()` returns a numeric code corresponding to +the HTTP status of the response _res_. + +For convenience, a number of predefined symbols corresponding to well-known +HTTP status codes are available. + +[source, c] +---- +enum { + NNG_HTTP_STATUS_CONTINUE = 100, + NNG_HTTP_STATUS_SWITCHING = 101, + NNG_HTTP_STATUS_PROCESSING = 102, + NNG_HTTP_STATUS_OK = 200, + NNG_HTTP_STATUS_CREATED = 201, + NNG_HTTP_STATUS_ACCEPTED = 202, + NNG_HTTP_STATUS_NOT_AUTHORITATIVE = 203, + NNG_HTTP_STATUS_NO_CONTENT = 204, + NNG_HTTP_STATUS_RESET_CONTENT = 205, + NNG_HTTP_STATUS_PARTIAL_CONTENT = 206, + NNG_HTTP_STATUS_MULTI_STATUS = 207, + NNG_HTTP_STATUS_ALREADY_REPORTED = 208, + NNG_HTTP_STATUS_IM_USED = 226, + NNG_HTTP_STATUS_MULTIPLE_CHOICES = 300, + NNG_HTTP_STATUS_STATUS_MOVED_PERMANENTLY = 301, + NNG_HTTP_STATUS_FOUND = 302, + NNG_HTTP_STATUS_SEE_OTHER = 303, + NNG_HTTP_STATUS_NOT_MODIFIED = 304, + NNG_HTTP_STATUS_USE_PROXY = 305, + NNG_HTTP_STATUS_TEMPORARY_REDIRECT = 307, + NNG_HTTP_STATUS_PERMANENT_REDIRECT = 308, + NNG_HTTP_STATUS_BAD_REQUEST = 400, + NNG_HTTP_STATUS_UNAUTHORIZED = 401, + NNG_HTTP_STATUS_PAYMENT_REQUIRED = 402, + NNG_HTTP_STATUS_FORBIDDEN = 403, + NNG_HTTP_STATUS_NOT_FOUND = 404, + NNG_HTTP_STATUS_METHOD_NOT_ALLOWED = 405, + NNG_HTTP_STATUS_NOT_ACCEPTABLE = 406, + NNG_HTTP_STATUS_PROXY_AUTH_REQUIRED = 407, + NNG_HTTP_STATUS_REQUEST_TIMEOUT = 408, + NNG_HTTP_STATUS_CONFLICT = 409, + NNG_HTTP_STATUS_GONE = 410, + NNG_HTTP_STATUS_LENGTH_REQUIRED = 411, + NNG_HTTP_STATUS_PRECONDITION_FAILED = 412, + NNG_HTTP_STATUS_PAYLOAD_TOO_LARGE = 413, + NNG_HTTP_STATUS_ENTITY_TOO_LONG = 414, + NNG_HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE = 415, + NNG_HTTP_STATUS_RANGE_NOT_SATISFIABLE = 416, + NNG_HTTP_STATUS_EXPECTATION_FAILED = 417, + NNG_HTTP_STATUS_TEAPOT = 418, + NNG_HTTP_STATUS_UNPROCESSABLE_ENTITY = 422, + NNG_HTTP_STATUS_LOCKED = 423, + NNG_HTTP_STATUS_FAILED_DEPENDENCY = 424, + NNG_HTTP_STATUS_UPGRADE_REQUIRED = 426, + NNG_HTTP_STATUS_PRECONDITION_REQUIRED = 428, + NNG_HTTP_STATUS_TOO_MANY_REQUESTS = 429, + NNG_HTTP_STATUS_HEADERS_TOO_LARGE = 431, + NNG_HTTP_STATUS_UNAVAIL_LEGAL_REASONS = 451, + NNG_HTTP_STATUS_INTERNAL_SERVER_ERROR = 500, + NNG_HTTP_STATUS_NOT_IMPLEMENTED = 501, + NNG_HTTP_STATUS_BAD_GATEWAY = 502, + NNG_HTTP_STATUS_SERVICE_UNAVAILABLE = 503, + NNG_HTTP_STATUS_GATEWAY_TIMEOUT = 504, + NNG_HTTP_STATUS_HTTP_VERSION_NOT_SUPP = 505, + NNG_HTTP_STATUS_VARIANT_ALSO_NEGOTIATES = 506, + NNG_HTTP_STATUS_INSUFFICIENT_STORAGE = 507, + NNG_HTTP_STATUS_LOOP_DETECTED = 508, + NNG_HTTP_STATUS_NOT_EXTENDED = 510, + NNG_HTTP_STATUS_NETWORK_AUTH_REQUIRED = 511, +} +---- + +TIP: When displaying status information to users (or logging such information), +consider also including the "reason phrase" obtained with +<<nng_http_res_get_reason#,nng_http_res_get_reason(3)>>. + +== RETURN VALUES + +HTTP status code. + +== ERRORS + +None. + +== SEE ALSO + +<<nng_http_res_alloc#,nng_http_res_alloc(3)>>, +<<nng_http_res_get_reason#,nng_http_res_get_reason(3)>>, +<<nng_http_res_set_status#,nng_http_res_set_status(3)>>, +<<nng#,nng(7)>> + + +== COPYRIGHT + +Copyright 2018 mailto:info@staysail.tech[Staysail Systems, Inc.] + +Copyright 2018 mailto:info@capitar.com[Capitar IT Group BV] + +This document is supplied under the terms of the +https://opensource.org/licenses/MIT[MIT License]. |
