0.2.3 • Published 7 years ago

laravel-fetch-wrapper v0.2.3

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Laravel-fetch-wrapper

Description

A wrapper to use the fetch API with Laravel JSON API's also extracts the json data out of the request.

Usage

//import the library
import fetchWrapper from 'laravel-fetch-wrapper'

//set the Laravel CSRF Token
fetchWrapper.setToken(window.csrfToken)

//GET request
fetchWrapper.get('url')
	.then(res =>{
		//do stuff with the json data
	})
	.catch(err => {
		//handle error
	})

//POST request
fetchWrapper.post('url',data)
	.then(res =>{
		//do stuff with the json data
	})
	.catch(err => {
		//handle error
	})
0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago