pass header in axios
const headers = {
'Content-Type': 'application/json',
'Authorization': 'JWT fefege...'
}
axios.post(Helper.getUserAPI(), data, {
headers: headers
})
.then((response) => {
dispatch({
type: FOUND_USER,
data: response.data[0]
})
})
.catch((error) => {
dispatch({
type: ERROR_FINDING_USER
})
})
Also in JavaScript:
- get current month of year in number javascript
- how to get duplicate values from array in javascript
- js check if div have another div
- react map array limit
- set timer
- javascript pluck from array of objects
- javascript sendredirect
- string repeat javascript
- How to remove the first and the last character of a string
- user property in express jwt
- javascript every method
- rebuild android react native
- go to another page javascript
- react 17
- how to get the number of days in a month in javascript
- ion button transparent
- javascript change background color
- chat application in react js
- javascript loadImage
- elasticsearch aggregation unique values
- switch in react
- create overlay js
- javascript clone array of objects
- js rounding