HTTP Request Methods
All of the Frisby.js HTTP methods are based on the fetch()
API standard. Frisby.js offers pre-defined get
, post
, put
, and del
for convenience and better readability.
If you need to do something custom like send requests through a proxy, you can also use fetch
method directly with custom options from the fetch
spec.
frisby.get(url)
Issues an HTTP GET request.
frisby.post(url, [params])
Issues an HTTP POST request, with optional provided parameters.
Assumes JSON and sends the header Content-Type: application/json
by default.
frisby.put(url, [params])
Issues an HTTP PUT request, with optional provided parameters. Semantics are the same as frisby.post()
.
frisby.del(url)
Issues an HTTP DELETE request.
frisby.fetch(url, [options])
If you need to do something custom, or if for some reason none of the above helper HTTP methods suit your needs, you can use fetch
directly, which accepts all the same options and parameters as the Fetch API - Frisby.js just passes them through for your request.
Last updated