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…