Headers Error
Hello, I keep getting the error:
Please help my code:
{
success: false,
errors: [
{
code: 6003,
message: 'Invalid request headers',
error_chain: [Array]
}
],
messages: [],
result: null
}
{
success: false,
errors: [
{
code: 6003,
message: 'Invalid request headers',
error_chain: [Array]
}
],
messages: [],
result: null
}
const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json', 'X-Auth-Email': '[email protected]', 'X-Auth-Key': 'NOT TODAY'},
body: '{"value":"medium"}'
};
fetch(`https://api.cloudflare.com/client/v4/zones/${zone_identifier}/settings/security_level`, options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err))
const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json', 'X-Auth-Email': '[email protected]', 'X-Auth-Key': 'NOT TODAY'},
body: '{"value":"medium"}'
};
fetch(`https://api.cloudflare.com/client/v4/zones/${zone_identifier}/settings/security_level`, options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err))
0 Replies