efetch
extend the whatwg fetch
- fetch spec,
makes it easier to use.
document
-
config - set options
-
set() - set http header
-
send() - send body data
-
query() - set query string
-
append() - append form data
-
text() - convert response body to
string
-
json() - convert response body to
object
-
default options
mode: 'cors' cache: 'no-cache' credentials: 'same-origin'
Usage
efetch // get json body efetch // get text body efetch text // send json efetch // send urlencoded efetch // send urlencoded efetch // set header efetch // send form (upload file) efetch
License
MIT