diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-01-06 15:20:09 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-01-09 23:22:56 -0800 |
| commit | 73f50e2679525e7df8734c875a3c12732565f953 (patch) | |
| tree | 23bd167dfcd95305b58a29c142b51879011f63b2 /docs/man/nng_http_res_set_status.3http.adoc | |
| parent | a381af4f5ca79576a4a9b461529a0f22fcf1e088 (diff) | |
| download | nng-2.0.0-alpha.3.tar.gz nng-2.0.0-alpha.3.tar.bz2 nng-2.0.0-alpha.3.zip | |
http: The big HTTP API refactoring of January 2025.v2.0.0-alpha.3http-client-trans
This represents a major change in the HTTP code base, consisting
of a complete revamp of the HTTP API. The changes here are too
numerous to mention, but the end result should be a vastly
simpler API for both server and client applications.
Many needless allocations were removed by providing fixed buffers
for various parameters and headers when possible.
A few bugs were fixed. Most especially we have fixed some bugs
around very large URIs and headers, and we have also addressed
conformance bugs to more closely conform to RFCs 9110 and 9112.
As part of this work, the APIs for WebSockets changed slightly
as well. In particular the properties available for accessing
headers have changed.
There is still documentation conversion work to do, and additional
functionality (such as proper support for chunked transfers), but
this is a big step in the right direction.
Diffstat (limited to 'docs/man/nng_http_res_set_status.3http.adoc')
| -rw-r--r-- | docs/man/nng_http_res_set_status.3http.adoc | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/docs/man/nng_http_res_set_status.3http.adoc b/docs/man/nng_http_res_set_status.3http.adoc deleted file mode 100644 index a1374941..00000000 --- a/docs/man/nng_http_res_set_status.3http.adoc +++ /dev/null @@ -1,115 +0,0 @@ -= nng_http_res_set_status(3http) -// -// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> -// Copyright 2018 Capitar IT Group BV <info@capitar.com> -// -// This document 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_set_status - set HTTP response status - -== SYNOPSIS - -[source, c] ----- -#include <nng/nng.h> -#include <nng/supplemental/http/http.h> - -void nng_http_res_set_status(nng_http_res *res, uint16_t status); ----- - -== DESCRIPTION - -The `nng_http_res_set_status()` sets the numeric HTTP status code -associated with the response _res_ to _status_. -The default value for a newly allocated response is 200 (`NNG_HTTP_STATUS_OK`). - -The _status_ is not verified, so the caller should take care to ensure -that only a valid code is supplied. - -For convenience, a number of predefined symbols 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, -}; ----- - -Please see the relevant HTTP RFCs for the semantics and correct -use of these status codes. - -TIP: It is a good idea to also set the reason message with -xref:nng_http_res_set_reason.3http.adoc[`nng_http_set_reason()`]. -This will help any humans who may have to diagnose a failure. - -== SEE ALSO - -[.text-left] -xref:nng_http_res_alloc.3http.adoc[nng_http_res_alloc(3http)], -xref:nng_http_res_get_status.3http.adoc[nng_http_req_get_status(3http)], -xref:nng_http_res_set_reason.3http.adoc[nng_http_req_set_reason(3http)], -xref:nng.7.adoc[nng(7)] |
