Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Functions HttpClient.request

1
2
3
4
5
6

Documentation

Sends a request to the server and returns the response.

This is the 'Simple' way to send a request, and is the easiest to use.

Notes

This function will automatically add the Hostheader if it is not already present.

If the request has a body and does not have a Content-Lengthor Transfer-Encodingheader, then this function will automatically add a Transfer-Encoding: chunkedheader.

If the request does not have a Hostheader, then this function will automatically add one using the hostprovided by the relevant connect function that was used.

The client will gracefully close the connection in normal circumstances such as the Connection: closeheader being present.

The state of the responseparameter is undefined if this function returns an error.

This function will automatically close the connection if an error occurs.

Assertions

The client must be connected.

Params

Throws

Anything that TcpSocket.sendor TcpSocket.receivecan throw.

If using HTTP1, anything that Http1Writeror Http1Readercan throw (`Http1Error`).

Returns

A Resultindicating whether the request was successful or not.