perform HTTP request to url with given data and get response
Parameters
request url :string
data :null :dictionary
Attributes
get | | perform a GET request (default) |
post | | perform a POST request |
patch | | perform a PATCH request |
put | | perform a PUT request |
delete | | perform a DELETE request |
json | | send data as Json |
headers | :dictionary | send custom HTTP headers |
agent | :string | use given user agent |
timeout | :integer | set a timeout |
proxy | :string | use given proxy url |
certificate | :string | use SSL certificate at given path |
raw | | return raw response without processing |
Returns
Examples
copy
print request "https://httpbin.org/get" #[some:"arg" another: 123]
copy
r: request "https://httpbin.org/get" #[some:"arg" another: 123]
body: read.json r\body
inspect body\headers
copy
print (request "https://httpbin.org/get" #[]) \ 'status
copy
print request.post "https://httpbin.org/post" #[some:"arg" another: 123]
Related