BuildableRequest¶
A HTTP Request that is created with trn
refcap
in order to be mutable, and then, when done, be consumed into
a val
reference. This is the way, the HTTP11RequestParser
is handling this class and so should you.
Implements¶
- Request val
Constructors¶
create¶
new trn create(
method': Method val = reference,
uri': URL val = reference,
version': ((HTTP09 val | HTTP10 val | HTTP11 val) & _Version val) = reference,
transfer_coding': (Chunked val | None val) = reference,
content_length': (USize val | None val) = reference)
: BuildableRequest trn^
Parameters¶
- method': Method val = reference
- uri': URL val = reference
- version': ((HTTP09 val | HTTP10 val | HTTP11 val) & _Version val) = reference
- transfer_coding': (Chunked val | None val) = reference
- content_length': (USize val | None val) = reference
Returns¶
- BuildableRequest trn^
Public Functions¶
method¶
The Request Method.
See: https://tools.ietf.org/html/rfc2616#section-5.1.1
Returns¶
- Method val
set_method¶
Parameters¶
- method': Method val
Returns¶
- BuildableRequest ref
uri¶
The request URI
See: https://tools.ietf.org/html/rfc2616#section-5.1.2
Returns¶
- URL val
set_uri¶
Parameters¶
- uri': URL val
Returns¶
- BuildableRequest ref
version¶
The HTTP version as given on the Request Line.
See: https://tools.ietf.org/html/rfc2616#section-3.1 and https://tools.ietf.org/html/rfc2616#section-5.1
Returns¶
set_version¶
fun ref set_version(
v: ((HTTP09 val | HTTP10 val | HTTP11 val) & _Version val))
: BuildableRequest ref
Parameters¶
Returns¶
- BuildableRequest ref
header¶
Case insensitive lookup of header value in this request.
Returns None
if no header with name exists in this request.
Parameters¶
- name: String val
Returns¶
headers¶
Returns¶
add_header¶
Add a header with name and value to this request. If a header with this name already exists, the given value will be appended to it, with a separating comma.
Parameters¶
Returns¶
- BuildableRequest ref
set_header¶
Set a header in this request to the given value.
If a header with this name already exists, the previous value will be overwritten.
Parameters¶
Returns¶
- BuildableRequest ref
clear_headers¶
Remove all previously set headers from this request.
Returns¶
- BuildableRequest ref
transfer_coding¶
If Chunked
the request body is encoded with Chunked Transfer-Encoding:
See: https://tools.ietf.org/html/rfc2616#section-3.6.1
If None
, no Transfer-Encoding is applied. A Content-Encoding might be applied
to the body.
Returns¶
set_transfer_coding¶
Parameters¶
Returns¶
- BuildableRequest ref
content_length¶
The content-length of the body of the request, counted in number of bytes.
If the content-length is None
, the request either has no content-length set
or it's transfer-encoding is Chunked
: https://tools.ietf.org/html/rfc2616#section-3.6.1
Returns¶
set_content_length¶
Parameters¶
- cl: USize val
Returns¶
- BuildableRequest ref
has_body¶
Returns true
if either we have Chunked Transfer-Encoding
or a given Content-Length. In those cases we can expect a body.
Returns¶
- Bool val