axios allows us to set a common header for requests code example
Example 1: header in axios
axios.post('url', {"body":data}, {
headers: {
'Content-Type': 'application/json'
}
}
)
Example 2: axios set request header
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET, POST, OPTIONS, HEAD");
header("Access-Control-Allow-Headers: Content-Type, header1");