it would be great if someone can help me with this issue.
i have set the header of all apis to "Content-Type": "application/json"
but now we need to have a different Content-Type
for sending images with JSON content like 'Content-Type': 'multipart/form-data"
how can i define a new header that renders every time we declare it
and how can i do this by code?
const httpClient = axios.create({
headers: {
"Content-Type": "application/json",
}
})
in our apis
export const create = (data) => {
return httpClient({
url: '/api/create',
method: 'post',
headers: {
"X-CSRF-TOKEN"
},
data: data
})
}