On this page:
get
post
delete
head
options
patch
put
8.16.0.4

1 Sending Requests🔗ℹ

function

fun get(

  uri :: Bytes || String || url.URL || LiteralURL,

  ~session: session :: Session = Session.current(),

  ~method: method :: Method = #'get,

  ~close: close :: Any.to_boolean = #false,

  ~stream: stream :: Any.to_boolean = #false,

  ~headers: headers :: Headers = {},

  ~params: params :: List.of(url.KeyValue) = [],

  ~auth: auth :: maybe(auth.Function) = #false,         

  ~data: data :: maybe(Bytes || String || Port.Input || payload.Function) = #false,

  ~timeouts: timeouts :: Timeouts = Timeouts(),

  ~max_attempts: max_attempts :: PosInt = 3,

  ~max_redirects: max_redirects :: PosInt = 16,

  ~user_agent: user_agent :: Bytes || String = current_user_agent()

) :: Response

 

function

fun post(....) :: Response

 

function

fun delete(....) :: Response

 

function

fun head(....) :: Response

 

function

fun options(....) :: Response

 

function

fun patch(....) :: Response

 

function

fun put(....) :: Response

Sends a request using the session argument’s Session.request method. All of these functions accept the same arguments as get, and each corresponds to calling Session.request with a corresponding ~method argument and passing along all the other arguments as given.

See Session.request for descriptions of the arguments other than session.