Like many of our categories in v6, API (REST) has moved to a functional approach in an effort to maintain a smaller bundle size and better tree-shaking. We are also using named params and strict typing for clarity and consistency.
For v6 REST APIs, all API's use the same underlying input/output types, although delete
and head
both omit the body
option.
API.get API.post API.put API.del API.patch API.head API.cancelNote: Setting
response
totrue
in v5 will result in the full response object being returned, including headers. Ifresponse
is set tofalse
or leftundefined
, the library returns the parsed JS object from the JSON response. In v6, the return object structure is always the same. (expand Output for details)
The process for cancelling a request has changed in v6. In v5 you send in the promise as input to the API.cancel API. In v6, cancel is a function returned with the result of an API(REST) operation. To cancel an operation, you will call operation.cancel()
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4