Contains functionality shared between the httpclient and asynchttpserver modules.
Unstable API.
HttpMethod = enum
HttpHead = "HEAD", ## Asks for the response identical to the one that
## would correspond to a GET request, but without
## the response body.
HttpGet = "GET", ## Retrieves the specified resource.
HttpPost = "POST", ## Submits data to be processed to the identified
## resource. The data is included in the body of
## the request.
HttpPut = "PUT", ## Uploads a representation of the specified
## resource.
HttpDelete = "DELETE", ## Deletes the specified resource.
HttpTrace = "TRACE", ## Echoes back the received request, so that a
## client
## can see what intermediate servers are adding or
## changing in the request.
HttpOptions = "OPTIONS", ## Returns the HTTP methods that the server
## supports for specified address.
HttpConnect = "CONNECT", ## Converts the request connection to a transparent
## TCP/IP tunnel, usually used for proxies.
HttpPatch = "PATCH" ## Applies partial modifications to a resource.Http102 = 102
Http103 = 103
Http207 = 207
Http208 = 208
Http226 = 226
Http402 = 402
Http423 = 423
Http424 = 424
Http425 = 425
Http506 = 506
Http507 = 507
Http508 = 508
Http510 = 510
Http511 = 511
func `[]`(headers: HttpHeaders; key: string): HttpHeaderValues {.
...raises: [KeyError], tags: [], forbids: [].}Returns the values associated with the given key. If the returned values are passed to a procedure expecting a string, the first value is automatically picked. If there are no values associated with the key, an exception is raised.
To access multiple values of a key, use the overloaded [] below or to get all of them access the table field directly.
func newHttpHeaders(keyValuePairs: openArray[tuple[key: string, val: string]];
titleCase = false): HttpHeaders {....raises: [KeyError],
tags: [], forbids: [].}HttpHeaders object from an array. if titleCase is set to true, headers are passed to the server in title case (e.g. "Content-Length") Source Edit
© 2006–2024 Andreas Rumpf
Licensed under the MIT License.
https://nim-lang.org/docs/httpcore.html