I am attempting to gzip my request payload using Axios. The request is:
axios({
url: url,
data,
headers: {
‘Content-Encoding’: ‘gzip’,
},
method: “POST”
})
With the backend response looking like this:
return {
statusCode: 200,
headers: {
‘Access-Control-Allow-Origin’: ‘*’,
‘Access-Control-Allow-Credentials’: true,
‘Access-Control-Allow-Methods’: ‘GET,POST,DELETE,OPTIONS’,
‘Access-Control-Allow-Headers’: ‘Access-Control-Allow-Headers, Origin, Accept, Authorization, X-Requested-With, Content-Encoding, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers’,
‘Content-type’: ‘application/pdf’,
},
body: url,
isBase64Encoded: true,
}
however I am still receiving the error message ‘Request header field content-encoding is not allowed by Access-Control-Allow-Headers in preflight response’
Can anyone tell where I am going wrong?
Thanks