SolarHosting Partner
SolarHosting Partner
Explore posts from servers
CDCloudflare Developers
Created by SolarHosting Partner on 7/26/2023 in #general-help
Headers Error
Hello, I keep getting the error:
{
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
}
Please help my code:
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))

1 replies