HttpRequest Type
A holder for the data extracted from the request.
Record fields
| Record Field | Description |
|
|
|
|
|
|
Full Usage:
httpVersion
Field type: string
|
|
|
|
Full Usage:
rawForm
Field type: byte[]
|
|
Full Usage:
rawHost
Field type: string
|
|
Full Usage:
rawMethod
Field type: string
|
|
Full Usage:
rawPath
Field type: string
|
|
Full Usage:
rawQuery
Field type: string
|
|
Instance members
| Instance member | Description |
Full Usage:
this[key]
Parameters:
string
Returns: string option
|
|
Full Usage:
this.clientHost trustProxy sources
Parameters:
bool
sources : string list
Returns: Host
|
Get the client's view of what host is being called. If you trust your proxy the value will be fetched from `X-Forwarded-Host`, then the `Host` headers. If you don't explicitly overwrite these headers in the proxy you may be open to clients spoofing the headers. Hence the explicit interfaces which force you as a developer to think about the problem.
|
|
|
|
|
Full Usage:
this.form
Returns: (string * string option) list
|
|
|
|
|
|
The `Host` that the web server responds to; not necessarily the host called by the client, as the request may have traversed proxies. As Suave binds to an IP rather than IP+Hostname, this can be anything the client has passed as the Host header. If you're behind a proxy, it may be the DNS name of the node that the reverse proxy forwards to, or if you're exposing Suave publically, it should match the public DNS name of the node. To ensure the correct host-name is being called, you can use `Http.host` in your web app.
|
|
|
|
Full Usage:
this.path
Returns: string
|
|
Full Usage:
this.query
Returns: (string * string option) list
|
Gets the query string from the `HttpRequest` as a list of `(key, value option)` tuples. If a key is present without value, the entry will be `(key, None)`. It will be `(key, Some value)` otherwise. If a key is present multiple times in the URL, this list will contain multiple entries. Use `queryParam` to try to fetch data for individual items.
|
Full Usage:
this.queryFlag flag
Parameters:
string
Returns: bool
|
|
|
Gets the value of the first matching query parameter with `key` in the `HttpRequest` as `Choice1Of2`. The `key` comparison is case-sensitive. If `key` is not present, or no value is present for the first occurrence of `key`, an error is returned as `Choice2Of2`. To access form data, use either `formData` to access normal form data, or `fieldData` to access the multipart-fields.
|
Full Usage:
this.queryParamOpt key
Parameters:
string
Returns: (string * string option) option
|
|
|