I'm trying to add the following query param into my axios call, but for some reason it's not accepting it.
const config = {
headers: {
'Content-Type': 'application/json',
}
}
const params = {
params: {
isAccepted: true
}
}
const url = `https://testapi.com`
axios.post(url, params, config)
However it works perfectly fine when I do it in this format
const config = {
headers: {
'Content-Type': 'application/json',
}
}
const url = `https://testapi.com?isAccepted=true`
axios.post(url, params, config)
Am I using the params field wrong in the axios call?