HTTP Request Variables
Request Variables
The following variables are available under the req
namespace:
Name | Type | Description |
---|---|---|
req.content_encoding | list[string] | The encodings set in the Content-Encoding header for this request. |
req.content_length | int64 | The content length of the body in bytes. This may not be present if the request does not contain a body or if the client does not specify a content length because they are streaming the body. |
req.content_type | string | The media type set in the Content-Type header for this request. |
req.content_type.parameters | map[string]string | The parameters set in the Content-Type header for this request. |
req.content_type.raw | string | The value of the Content-Type header for this request. |
req.cookies | map[string][]cookie | The HTTP cookie objects included in this request. If there are multiple cookies with the same name, they will be ordered as specified in the Cookie header. |
req.cookies[k][i].name | string | The name of the cookie. |
req.cookies[k][i].value | string | The value of the cookie. |
req.headers | map[string][]string | The request headers parsed as a map of lower-case names to values. |
req.host | string | The value of the host header field for this request. |
req.location | string | The value of the Location header for this request. |
req.method | string | The method for this request. |
req.trailers | map[string][]string | The request trailers parsed as a map of lower-case names to values. |
req.ts.body_received | timestamp | The timestamp when ngrok received the body of the request. This may not be present if the request does not contain a body. |
req.ts.header_received | timestamp | The timestamp when ngrok received the header of the request. |
req.url | string | The normalized full URL for this request. |
req.url.authority | string | The authority portion of the URL. |
req.url.host | string | The hostname portion of the host for this request. |
req.url.path | string | The path for this request including the leading forward slash. |
req.url.port | int32 | The port portion of the URL. This may not be present if the URL does not explicitly specify a port. |
req.url.query | string | The full query string for this request excluding the leading question mark. |
req.url.query_params | map[string][]string | The request query string parsed as a map of names to values. |
req.url.raw | string | The un-normalized full URL for this request. |
req.url.raw_path | string | The un-normalized path including the leading slash for this request. |
req.url.scheme | string | The scheme for this request. |
req.url.uri | string | The URI (path and query) portion of the URL. |
req.url.user_password | string | The user:password portion of the URL. |
req.user_agent | string | The value of the User-Agent header for this request. |
req.version | string | The HTTP version for this request. |
req.content_encoding
The encoding set in the Content-Encoding
header for this request.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.content_length
The content length of the body in bytes. This may not be present if the request does not contain a body or if the client does not specify a content length because they are streaming the body.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.content_type
The media type set in the Content-Type
header for this request.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.content_type.parameters
The parameters set in the Content-Type
header for this request.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.content_type.raw
The value of the Content-Type
header for this request.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.cookies
The HTTP cookie objects included in this request. If there are multiple cookies with the same name, they will be ordered as specified in the Cookie
header.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.cookies[k][i].name
The name of the cookie.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.cookies[k][i].value
The value of the cookie.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.headers
The request headers parsed as a map of lower-case names to values.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.host
The value of the host header field value for this request.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.location
The value of the Location header for this request.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.method
The method for this request.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.trailers
The request trailers parsed as a map of lower-case names to values.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.ts.body_received
The timestamp when ngrok received the body of the request. This may not be present if the request does not contain a body.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.ts.header_received
The timestamp when ngrok received the header of the request.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.url
The normalized full URL for this request.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.url.authority
The authority portion of the URL.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.url.host
The hostname portion of the host for this request.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.url.path
The path for this request including the leading forward slash.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.url.port
The port portion of the URL. This may not be present if the URL does not explicitly specify a port.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.url.query
The full query string for this request excluding the leading question mark.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.url.query_params
The request query string parsed as a map of names to values.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.url.raw
The un-normalized full URL for this request.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.url.raw_path
The un-normalized path including the leading slash for this request.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.url.scheme
The scheme for this request.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.url.uri
The URI (path and query) portion of the URL.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.url.user_password
The user:password
portion of the URL.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.user_agent
The value of the User-Agent
header for this request.
- YAML
- JSON
Loading…
Loading…
Show agent config example
req.version
The HTTP version for this request.
- YAML
- JSON
Loading…
Loading…
Show agent config example