1.0.5 • Published 6 years ago
eigen-fetch v1.0.5
eigen-fetch
This project is a polyfill that implements a subset of the standard Fetch specification, enough to make fetch a viable replacement for most uses of XMLHttpRequest in traditional web applications.
Installation
npm install eigen-fetch --save
yarn add eigen-fetch
Usage
import EigenFetch, { request, fetch } from 'eigen-fetch';
export default createWork(data) {
return fetch(`/works`,{
method: "POST",
headers: {
'Content-Type': 'application/json',
credentials: "include"
},
body: JSON.stringify(data)
});
}
or
export default createWork(data) {
return EigenFetch.post(`/works`, data)
}