---
description: Contains functions that can be applied to HttpRequest structures
---

# pdk.flow.HttpRequest

### All functions

* [getHeader](#getheader)
* [getHeaderValue](#getheadervalue)
* [getHeaderValues](#getheadervalues)
* [isHeaderExists](#isheaderexists)
* [getCookie](#getcookie)
* [isCookieExists](#iscookieexists)

***

### getHeader

Gets a header by name. If the request contains multiple headers with the same name, only the first will be returned.

Arguments:

* request :: [pdk.net.http.Request](../../../../structures/pdk.net.http#request)
* headerName :: [pdk.core.String](../../../../structures/pdk.core#string)

Result:

* output :: [pdk.net.http.Header](../../../../structures/pdk.net.http#header) - header or `NULL` if it doesn't exist

Possible exceptions

* [NullPointerException](../../../exceptions/runtime-exceptions#nullpointerexception) - throws an error if at least one argument is `NULL`

***

### getHeaderValue

Gets the value of a header by name. If the request contains multiple headers with the same name, only the first value will be returned.

Arguments:

* request :: [pdk.net.http.Request](../../../../structures/pdk.net.http#request)
* headerName :: [pdk.core.String](../../../../structures/pdk.core#string)

Result:

* output :: [pdk.core.String](../../../../structures/pdk.core#string) - Header value as String or `NULL` if it doesn't exist

Possible exceptions

* [NullPointerException](../../../exceptions/runtime-exceptions#nullpointerexception) - throws an error if at least one argument is `NULL`

***

### getHeaderValues

Get header values by name. Use this function in case of multiple headers with the same name.

Arguments:

* request :: [pdk.net.http.Request](../../../../structures/pdk.net.http#request)
* headerName :: [pdk.core.String](../../../../structures/pdk.core#string)

Result:

* output :: [pdk.core.Array](../../../../structures/pdk.core#array)<[pdk.core.String](../../../../structures/pdk.core#string)> - Header values in String format , or `NULL` if the header doesn't exist.

Possible exceptions

* [NullPointerException](../../../exceptions/runtime-exceptions#nullpointerexception) - throws an error if at least one argument is `NULL`

***

### isHeaderExists

Determines whether the header exists in the request.

Arguments:

* request :: [pdk.net.http.Request](../../../../structures/pdk.net.http#request)
* headerName :: [pdk.core.String](../../../../structures/pdk.core#string)

Result:

* output :: [pdk.core.Boolean](../../../../structures/pdk.core#boolean) - `true` if the header exists

Possible exceptions

* [NullPointerException](../../../exceptions/runtime-exceptions#nullpointerexception) - throws an error if at least one argument is `NULL`

***

### getCookie

Gets a cookie by name.&#x20;

Arguments:

* request :: [pdk.net.http.Request](../../../../structures/pdk.net.http#request)
* cookieName :: [pdk.core.String](../../../../structures/pdk.core#string)

Result:

* output :: [pdk.net.http.Cookie](../../../../structures/pdk.net.http#cookie) - cookie or `NULL` if it doesn't exist

Possible exceptions

* [NullPointerException](../../../exceptions/runtime-exceptions#nullpointerexception) - throws an error if at least one argument is `NULL`

***

### isCookieExists

Determines whether the cookie exists in the request.

Arguments:

* request :: [pdk.net.http.Request](../../../../structures/pdk.net.http#request)
* cookieName :: [pdk.core.String](../../../../structures/pdk.core#string)

Result:

* output :: [pdk.core.Boolean](../../../../structures/pdk.core#boolean) - `true` if the cookie exists

Possible exceptions

* [NullPointerException](../../../exceptions/runtime-exceptions#nullpointerexception) - throws an error if at least one argument is `NULL`
