1.7.4 • Published 6 years ago
howhap-fetch v1.7.4
howhap fetch
npm install --save howhap-fetch
Promise based AJAX library that supports howhap errors.
Usage
import fetch from 'howhap-fetch';
fetch.get('/api/v1/products')
.then(function(products) {
console.log(products);
})
.catch(function(err) {
console.log(err.display());
});
Methods
- All methods are promise based.
.then(...)
will receive the data that was returned from the server as JSON..catch(...)
will receive a howhap list of errors returned from the server and supports all howhap list methods.
fetch.get(url, data)
Make a GET request to the specified url.
- url: the url to make the request
- data: object of key/value pairs to be encoded into the url as query parameters
fetch.post(url, data)
Make a POST request to the specified url.
- url: the url to make the request
- data: object of key/value pairs to be encoded into the body
fetch.put(url, data)
Make a PUT request to the specified url.
- url: the url to make the request
- data: object of key/value pairs to be encoded into the body
fetch.delete(url, data)
Make a DELETE request to the specified url.
- url: the url to make the request
- data: object of key/value pairs to be encoded into the body
1.7.4
6 years ago
1.7.3
6 years ago
1.7.2
6 years ago
1.7.1
6 years ago
1.7.0
6 years ago
1.6.0
6 years ago
1.5.7
7 years ago
1.5.6
7 years ago
1.5.5
7 years ago
1.5.4
7 years ago
1.5.3
7 years ago
1.5.2
7 years ago
1.5.1
7 years ago
1.5.0
7 years ago
1.4.0
7 years ago
1.3.2
7 years ago
1.3.1
7 years ago
1.3.0
7 years ago
1.2.0
7 years ago
1.1.2
8 years ago
1.1.1
8 years ago
1.1.0
8 years ago