# Request

<a id="request-6"></a>

# Request

```cpp
#include <icy/http/request.h>

class Request
```

[Defined in src/http/include/icy/http/request.h:44](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L44)

> **Inherits:** [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1)

HTTP request message with method, URI, headers, and optional body.

In addition to the properties common to all HTTP messages, an HTTP request has a method (e.g. GET, HEAD, POST, etc.) and a request URI.

## List of all members

| Name | Kind | Owner |
|------|------|-------|
| [`operator<<`](#operator-206) | `friend` | Declared here |
| [`Request`](#request-7) | `function` | Declared here |
| [`Request`](#request-8) | `function` | Declared here |
| [`Request`](#request-9) | `function` | Declared here |
| [`Request`](#request-10) | `function` | Declared here |
| [`~Request`](#request-11) | `function` | Declared here |
| [`setMethod`](#setmethod) | `function` | Declared here |
| [`getMethod`](#getmethod) | `function` | Declared here |
| [`setURI`](#seturi) | `function` | Declared here |
| [`appendURI`](#appenduri) | `function` | Declared here |
| [`getURI`](#geturi) | `function` | Declared here |
| [`setHost`](#sethost) | `function` | Declared here |
| [`setHost`](#sethost-1) | `function` | Declared here |
| [`getHost`](#gethost) | `function` | Declared here |
| [`setCookies`](#setcookies) | `function` | Declared here |
| [`getCookies`](#getcookies) | `function` | Declared here |
| [`getURIParameters`](#geturiparameters) | `function` | Declared here |
| [`hasCredentials`](#hascredentials) | `function` | Declared here |
| [`getCredentials`](#getcredentials) | `function` | Declared here |
| [`setCredentials`](#setcredentials) | `function` | Declared here |
| [`hasProxyCredentials`](#hasproxycredentials) | `function` | Declared here |
| [`getProxyCredentials`](#getproxycredentials) | `function` | Declared here |
| [`setProxyCredentials`](#setproxycredentials) | `function` | Declared here |
| [`write`](#write-27) | `function` | Declared here |
| [`write`](#write-28) | `function` | Declared here |
| [`write`](#write-29) | `function` | Declared here |
| [`getCredentials`](#getcredentials-1) | `function` | Declared here |
| [`setCredentials`](#setcredentials-1) | `function` | Declared here |
| [`_method`](#_method) | `variable` | Declared here |
| [`_uri`](#_uri) | `variable` | Declared here |
| [`setVersion`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#setversion-1) | `function` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`getVersion`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#getversion-1) | `function` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`setContentLength`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#setcontentlength) | `function` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`getContentLength`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#getcontentlength) | `function` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`hasContentLength`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#hascontentlength) | `function` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`setTransferEncoding`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#settransferencoding) | `function` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`getTransferEncoding`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#gettransferencoding) | `function` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`setChunkedTransferEncoding`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#setchunkedtransferencoding) | `function` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`isChunkedTransferEncoding`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#ischunkedtransferencoding) | `function` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`setContentType`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#setcontenttype) | `function` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`getContentType`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#getcontenttype) | `function` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`setKeepAlive`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#setkeepalive-1) | `function` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`getKeepAlive`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#getkeepalive) | `function` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`write`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#write-24) | `function` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`write`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#write-25) | `function` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`write`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#write-26) | `function` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`HTTP_1_0`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#http_1_0) | `variable` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`HTTP_1_1`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#http_1_1) | `variable` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`IDENTITY_TRANSFER_ENCODING`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#identity_transfer_encoding) | `variable` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`CHUNKED_TRANSFER_ENCODING`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#chunked_transfer_encoding) | `variable` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`UNKNOWN_CONTENT_LENGTH`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#unknown_content_length) | `variable` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`UNKNOWN_CONTENT_TYPE`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#unknown_content_type) | `variable` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`CONTENT_LENGTH`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#content_length) | `variable` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`CONTENT_TYPE`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#content_type) | `variable` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`TRANSFER_ENCODING`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#transfer_encoding) | `variable` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`CONNECTION`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#connection-7) | `variable` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`CONNECTION_KEEP_ALIVE`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#connection_keep_alive) | `variable` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`CONNECTION_CLOSE`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#connection_close) | `variable` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`EMPTY`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#empty-4) | `variable` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`_version`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#_version-1) | `variable` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-2) | `function` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-3) | `function` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`~Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-4) | `function` | Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) |
| [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection-1) | `function` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection-2) | `function` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection-3) | `function` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`~NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection-4) | `function` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`operator=`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#operator-64) | `function` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`operator=`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#operator-65) | `function` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`operator[]`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#operator-66) | `function` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`set`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#set-1) | `function` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`add`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#add-4) | `function` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`add`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#add-5) | `function` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`get`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#get-7) | `function` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`get`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#get-8) | `function` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`has`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#has-2) | `function` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`find`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#find) | `function` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`begin`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#begin-5) | `function` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`end`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#end-2) | `function` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`empty`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#empty-2) | `function` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`size`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#size-5) | `function` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`erase`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#erase-1) | `function` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`clear`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#clear-3) | `function` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`Map`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#map-6) | `typedef` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`Iterator`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#iterator) | `typedef` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`ConstIterator`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#constiterator) | `typedef` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |
| [`_map`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#_map-2) | `variable` | Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) |

## Inherited from [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1)

| Kind | Name | Description |
|------|------|-------------|
| `function` | [`setVersion`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#setversion-1)  | Sets the HTTP version for this message. |
| `function` | [`getVersion`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#getversion-1) `const` | Returns the HTTP version for this message. |
| `function` | [`setContentLength`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#setcontentlength)  | Sets the Content-Length header. |
| `function` | [`getContentLength`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#getcontentlength) `const` | Returns the content length for this message, which may be UNKNOWN_CONTENT_LENGTH if no Content-Length header is present. |
| `function` | [`hasContentLength`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#hascontentlength) `const` | Returns true if a Content-Length header is present. |
| `function` | [`setTransferEncoding`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#settransferencoding)  | Sets the transfer encoding for this message. |
| `function` | [`getTransferEncoding`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#gettransferencoding) `const` | Returns the transfer encoding used for this message. |
| `function` | [`setChunkedTransferEncoding`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#setchunkedtransferencoding)  | If flag is true, sets the Transfer-Encoding header to chunked. Otherwise, removes the Transfer-Encoding header. |
| `function` | [`isChunkedTransferEncoding`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#ischunkedtransferencoding) `const` | Returns true if the Transfer-Encoding header is set and its value is chunked. |
| `function` | [`setContentType`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#setcontenttype)  | Sets the content type for this message. |
| `function` | [`getContentType`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#getcontenttype) `const` | Returns the content type for this message. |
| `function` | [`setKeepAlive`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#setkeepalive-1)  | Sets the value of the [Connection](https://auscaster.com/icey/docs/api-reference/icy-http-Connection.md#connection-1) header field. |
| `function` | [`getKeepAlive`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#getkeepalive) `const` | Returns true if |
| `function` | [`write`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#write-24) `virtual` `const` | Writes the message header to the given output stream. |
| `function` | [`write`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#write-25) `virtual` `const` | Writes the message header to the given output string. |
| `function` | [`write`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#write-26) `virtual` `const` | Writes the message header directly into a byte buffer. |
| `variable` | [`HTTP_1_0`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#http_1_0) `static` |  |
| `variable` | [`HTTP_1_1`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#http_1_1) `static` |  |
| `variable` | [`IDENTITY_TRANSFER_ENCODING`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#identity_transfer_encoding) `static` |  |
| `variable` | [`CHUNKED_TRANSFER_ENCODING`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#chunked_transfer_encoding) `static` |  |
| `variable` | [`UNKNOWN_CONTENT_LENGTH`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#unknown_content_length) `static` |  |
| `variable` | [`UNKNOWN_CONTENT_TYPE`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#unknown_content_type) `static` |  |
| `variable` | [`CONTENT_LENGTH`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#content_length) `static` |  |
| `variable` | [`CONTENT_TYPE`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#content_type) `static` |  |
| `variable` | [`TRANSFER_ENCODING`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#transfer_encoding) `static` |  |
| `variable` | [`CONNECTION`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#connection-7) `static` |  |
| `variable` | [`CONNECTION_KEEP_ALIVE`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#connection_keep_alive) `static` |  |
| `variable` | [`CONNECTION_CLOSE`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#connection_close) `static` |  |
| `variable` | [`EMPTY`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#empty-4) `static` |  |
| `variable` | [`_version`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#_version-1)  |  |
| `function` | [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-2)  | Creates the [Message](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) with version HTTP/1.0. |
| `function` | [`Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-3)  | Creates the [Message](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1) and sets the version. |
| `function` | [`~Message`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-4) `virtual` | Destroys the [Message](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#message-1). |

## Inherited from [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection)

| Kind | Name | Description |
|------|------|-------------|
| `function` | [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection-1) `inline` |  |
| `function` | [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection-2) `inline` |  |
| `function` | [`NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection-3) `inline` `noexcept` |  |
| `function` | [`~NVCollection`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection-4) `virtual` `inline` |  |
| `function` | [`operator=`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#operator-64)  | Assigns the name-value pairs of another [NVCollection](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#nvcollection) to this one. |
| `function` | [`operator=`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#operator-65) `noexcept` |  |
| `function` | [`operator[]`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#operator-66) `const` | Returns the value of the (first) name-value pair with the given name. |
| `function` | [`set`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#set-1)  | Sets the value of the (first) name-value pair with the given name. |
| `function` | [`add`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#add-4)  | Adds a new name-value pair with the given name and value. |
| `function` | [`add`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#add-5)  | Adds a new name-value pair using move semantics. |
| `function` | [`get`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#get-7) `const` | Returns the value of the first name-value pair with the given name. |
| `function` | [`get`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#get-8) `const` | Returns the value of the first name-value pair with the given name. If no value with the given name has been found, the defaultValue is returned. |
| `function` | [`has`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#has-2) `const` | Returns true if there is at least one name-value pair with the given name. |
| `function` | [`find`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#find) `const` | Returns an iterator pointing to the first name-value pair with the given name. |
| `function` | [`begin`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#begin-5) `const` | Returns an iterator pointing to the begin of the name-value pair collection. |
| `function` | [`end`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#end-2) `const` | Returns an iterator pointing to the end of the name-value pair collection. |
| `function` | [`empty`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#empty-2) `const` | Returns true iff the header does not have any content. |
| `function` | [`size`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#size-5) `const` | Returns the number of name-value pairs in the collection. |
| `function` | [`erase`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#erase-1)  | Removes all name-value pairs with the given name. |
| `function` | [`clear`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#clear-3)  | Removes all name-value pairs and their values. |
| `typedef` | [`Map`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#map-6)  |  |
| `typedef` | [`Iterator`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#iterator)  |  |
| `typedef` | [`ConstIterator`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#constiterator)  |  |
| `variable` | [`_map`](https://auscaster.com/icey/docs/api-reference/icy-NVCollection.md#_map-2)  |  |

## Friends

| Name | Description |
|------|-------------|
| [`operator<<`](#operator-206) `inline` |  |

---

<a id="operator-206"></a>

### operator<<

`inline`

```cpp
friend inline std::ostream & operator<<(std::ostream & stream, const Request & req)
```

[Defined in src/http/include/icy/http/request.h:146](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L146)

## Public Methods

| Return | Name | Description |
|--------|------|-------------|
|  | [`Request`](#request-7)  | Creates a GET / HTTP/1.1 HTTP request. |
|  | [`Request`](#request-8)  | Creates a GET / HTTP/1.x request with the given version (HTTP/1.0 or HTTP/1.1). |
|  | [`Request`](#request-9)  | Creates an HTTP/1.0 request with the given method and URI. |
|  | [`Request`](#request-10)  | Creates an HTTP request with the given method, URI and version. |
|  | [`~Request`](#request-11) `virtual` | Destroys the [Request](#request-6). |
| `void` | [`setMethod`](#setmethod)  | Sets the method. |
| `const std::string &` | [`getMethod`](#getmethod) `const` | Returns the method. |
| `void` | [`setURI`](#seturi)  | Sets the request URI. |
| `void` | [`appendURI`](#appenduri)  | Appends a fragment to the request URI. Used by the parser when llhttp splits the [URL](https://auscaster.com/icey/docs/api-reference/icy-http-URL.md#url) across callbacks. |
| `const std::string &` | [`getURI`](#geturi) `const` | Returns the request URI. |
| `void` | [`setHost`](#sethost)  | Sets the value of the Host header field. |
| `void` | [`setHost`](#sethost-1)  | Sets the value of the Host header field. |
| `const std::string &` | [`getHost`](#gethost) `const` | Returns the value of the Host header field. |
| `void` | [`setCookies`](#setcookies)  | Adds a [Cookie](https://auscaster.com/icey/docs/api-reference/icy-http-Cookie.md#cookie) header with the names and values from cookies. |
| `void` | [`getCookies`](#getcookies) `const` | Fills cookies with the cookies extracted from the [Cookie](https://auscaster.com/icey/docs/api-reference/icy-http-Cookie.md#cookie) headers in the request. |
| `void` | [`getURIParameters`](#geturiparameters) `const` | Returns the request URI parameters. |
| `bool` | [`hasCredentials`](#hascredentials) `const` | Returns true if the request contains authentication information in the form of an Authorization header. |
| `void` | [`getCredentials`](#getcredentials) `const` | Returns the authentication scheme and additional authentication information contained in this request. |
| `void` | [`setCredentials`](#setcredentials)  | Sets the authentication scheme and information for this request. |
| `bool` | [`hasProxyCredentials`](#hasproxycredentials) `const` | Returns true if the request contains proxy authentication information in the form of an Proxy-Authorization header. |
| `void` | [`getProxyCredentials`](#getproxycredentials) `const` | Returns the proxy authentication scheme and additional proxy authentication information contained in this request. |
| `void` | [`setProxyCredentials`](#setproxycredentials)  | Sets the proxy authentication scheme and information for this request. |
| `void` | [`write`](#write-27) `virtual` `const` | Writes the HTTP request to the given output stream. |
| `void` | [`write`](#write-28) `virtual` `const` | Writes the HTTP request to the given output string. |
| `void` | [`write`](#write-29) `virtual` `const` | Writes the HTTP request directly into a byte buffer. |

---

<a id="request-7"></a>

### Request

```cpp
Request()
```

[Defined in src/http/include/icy/http/request.h:48](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L48)

Creates a GET / HTTP/1.1 HTTP request.

---

<a id="request-8"></a>

### Request

```cpp
Request(const std::string & version)
```

[Defined in src/http/include/icy/http/request.h:52](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L52)

Creates a GET / HTTP/1.x request with the given version (HTTP/1.0 or HTTP/1.1).

---

<a id="request-9"></a>

### Request

```cpp
Request(const std::string & method, const std::string & uri)
```

[Defined in src/http/include/icy/http/request.h:55](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L55)

Creates an HTTP/1.0 request with the given method and URI.

---

<a id="request-10"></a>

### Request

```cpp
Request(const std::string & method, const std::string & uri, const std::string & version)
```

[Defined in src/http/include/icy/http/request.h:58](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L58)

Creates an HTTP request with the given method, URI and version.

---

<a id="request-11"></a>

### ~Request

`virtual`

```cpp
virtual ~Request()
```

[Defined in src/http/include/icy/http/request.h:61](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L61)

Destroys the [Request](#request-6).

---

<a id="setmethod"></a>

### setMethod

```cpp
void setMethod(const std::string & method)
```

[Defined in src/http/include/icy/http/request.h:64](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L64)

Sets the method.

---

<a id="getmethod"></a>

### getMethod

`const`

```cpp
const std::string & getMethod() const
```

[Defined in src/http/include/icy/http/request.h:67](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L67)

Returns the method.

---

<a id="seturi"></a>

### setURI

```cpp
void setURI(std::string uri)
```

[Defined in src/http/include/icy/http/request.h:70](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L70)

Sets the request URI.

---

<a id="appenduri"></a>

### appendURI

```cpp
void appendURI(std::string_view uri)
```

[Defined in src/http/include/icy/http/request.h:74](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L74)

Appends a fragment to the request URI. Used by the parser when llhttp splits the [URL](https://auscaster.com/icey/docs/api-reference/icy-http-URL.md#url) across callbacks.

---

<a id="geturi"></a>

### getURI

`const`

```cpp
const std::string & getURI() const
```

[Defined in src/http/include/icy/http/request.h:77](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L77)

Returns the request URI.

---

<a id="sethost"></a>

### setHost

```cpp
void setHost(const std::string & host)
```

[Defined in src/http/include/icy/http/request.h:80](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L80)

Sets the value of the Host header field.

---

<a id="sethost-1"></a>

### setHost

```cpp
void setHost(const std::string & host, uint16_t port)
```

[Defined in src/http/include/icy/http/request.h:87](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L87)

Sets the value of the Host header field.

If the given port number is a non-standard port number (other than 80 or 443), it is included in the Host header field.

---

<a id="gethost"></a>

### getHost

`const`

```cpp
const std::string & getHost() const
```

[Defined in src/http/include/icy/http/request.h:93](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L93)

Returns the value of the Host header field.

Throws a NotFoundException if the request does not have a Host header field.

---

<a id="setcookies"></a>

### setCookies

```cpp
void setCookies(const NVCollection & cookies)
```

[Defined in src/http/include/icy/http/request.h:97](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L97)

Adds a [Cookie](https://auscaster.com/icey/docs/api-reference/icy-http-Cookie.md#cookie) header with the names and values from cookies.

---

<a id="getcookies"></a>

### getCookies

`const`

```cpp
void getCookies(NVCollection & cookies) const
```

[Defined in src/http/include/icy/http/request.h:101](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L101)

Fills cookies with the cookies extracted from the [Cookie](https://auscaster.com/icey/docs/api-reference/icy-http-Cookie.md#cookie) headers in the request.

---

<a id="geturiparameters"></a>

### getURIParameters

`const`

```cpp
void getURIParameters(NVCollection & params) const
```

[Defined in src/http/include/icy/http/request.h:104](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L104)

Returns the request URI parameters.

---

<a id="hascredentials"></a>

### hasCredentials

`const`

```cpp
bool hasCredentials() const
```

[Defined in src/http/include/icy/http/request.h:108](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L108)

Returns true if the request contains authentication information in the form of an Authorization header.

---

<a id="getcredentials"></a>

### getCredentials

`const`

```cpp
void getCredentials(std::string & scheme, std::string & authInfo) const
```

[Defined in src/http/include/icy/http/request.h:115](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L115)

Returns the authentication scheme and additional authentication information contained in this request.

Throws a std::exception if no authentication information is contained in the request.

---

<a id="setcredentials"></a>

### setCredentials

```cpp
void setCredentials(std::string_view scheme, std::string_view authInfo)
```

[Defined in src/http/include/icy/http/request.h:119](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L119)

Sets the authentication scheme and information for this request.

---

<a id="hasproxycredentials"></a>

### hasProxyCredentials

`const`

```cpp
bool hasProxyCredentials() const
```

[Defined in src/http/include/icy/http/request.h:123](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L123)

Returns true if the request contains proxy authentication information in the form of an Proxy-Authorization header.

---

<a id="getproxycredentials"></a>

### getProxyCredentials

`const`

```cpp
void getProxyCredentials(std::string & scheme, std::string & authInfo) const
```

[Defined in src/http/include/icy/http/request.h:131](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L131)

Returns the proxy authentication scheme and additional proxy authentication information contained in this request.

Throws a std::exception if no proxy authentication information is contained in the request.

---

<a id="setproxycredentials"></a>

### setProxyCredentials

```cpp
void setProxyCredentials(std::string_view scheme, std::string_view authInfo)
```

[Defined in src/http/include/icy/http/request.h:134](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L134)

Sets the proxy authentication scheme and information for this request.

---

<a id="write-27"></a>

### write

`virtual` `const`

```cpp
virtual void write(std::ostream & ostr) const
```

[Defined in src/http/include/icy/http/request.h:138](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L138)

Writes the HTTP request to the given output stream.

#### Reimplements

- [`Message::write`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#write-24)

---

<a id="write-28"></a>

### write

`virtual` `const`

```cpp
virtual void write(std::string & str) const
```

[Defined in src/http/include/icy/http/request.h:141](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L141)

Writes the HTTP request to the given output string.

#### Reimplements

- [`Message::write`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#write-25)

---

<a id="write-29"></a>

### write

`virtual` `const`

```cpp
virtual void write(Buffer & buf) const
```

[Defined in src/http/include/icy/http/request.h:144](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L144)

Writes the HTTP request directly into a byte buffer.

#### Reimplements

- [`Message::write`](https://auscaster.com/icey/docs/api-reference/icy-http-Message.md#write-26)

## Protected Methods

| Return | Name | Description |
|--------|------|-------------|
| `void` | [`getCredentials`](#getcredentials-1) `const` | Returns the authentication scheme and additional authentication information contained in the given header of request. |
| `void` | [`setCredentials`](#setcredentials-1)  | Writes the authentication scheme and information for this request to the given header. |

---

<a id="getcredentials-1"></a>

### getCredentials

`const`

```cpp
void getCredentials(const std::string & header, std::string & scheme, std::string & authInfo) const
```

[Defined in src/http/include/icy/http/request.h:158](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L158)

Returns the authentication scheme and additional authentication information contained in the given header of request.

Throws a NotAuthenticatedException if no authentication information is contained in the request.

---

<a id="setcredentials-1"></a>

### setCredentials

```cpp
void setCredentials(const std::string & header, std::string_view scheme, std::string_view authInfo)
```

[Defined in src/http/include/icy/http/request.h:162](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L162)

Writes the authentication scheme and information for this request to the given header.

## Private Attributes

| Return | Name | Description |
|--------|------|-------------|
| `std::string` | [`_method`](#_method)  |  |
| `std::string` | [`_uri`](#_uri)  |  |

---

<a id="_method"></a>

### _method

```cpp
std::string _method
```

[Defined in src/http/include/icy/http/request.h:165](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L165)

---

<a id="_uri"></a>

### _uri

```cpp
std::string _uri
```

[Defined in src/http/include/icy/http/request.h:166](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/request.h#L166)
