.send()
is added, allowing you to gradually build your request..get()
/ .post(body)
/ .put(body)
/ .patch(body)
/ .delete()
: set the request verb, and add an optional JSON-formatted body
.set(data)
: set the request headers, where {"x-api-key":"somevalue"}
is added as x-api-key:somevalue
headers.auth(username, password)
set basic auth headers.query(data)
: set the query strings, where {"key":"value"}
is automatically translated to ?key=value
.disable_ssl_verify()
: for situations where you know that the endpoint comes with an invalid SSL certificate, you can disable SSL verification to bypass this protection. This option should only be used if you know what you are doing!.is_error()
method on the response object..get_info()
method lets you inspect the response of HTTP calls, even when the call returns an error (in which case .get_info()
will also contain the body):.is_error()
and .get_info()
are very useful methods to correctly handle HTTP responses!