Reputation: 318
I have been creating a web application using ReactJS and Symfony, I want to add a multi language functionality to my application. The problem is when I add locale to requests as a header parameter, I'm getting a Failed to load response data
, also I see the message Provisional headers are shown
const instance = axios.create({
baseURL: 'myapp.com',
headers: {
'Content-Type': 'application/ld+json',
locale: 'en'
}});
when I remove the parameter locale it work correctly and the request passed to the API and the worning message "Provisional headers are shown" disappear from the browser.
how can I solve the problem ?. Thanks.
Upvotes: 1
Views: 17947
Reputation: 318
I added the locale to the list of parameters accepted in the allow_header section of the API and now it works.
allow_headers: ['Content-Type', 'Authorization', 'locale']
Upvotes: 0
Reputation: 13588
Do you mean you want to set the accept language?
headers: {
"Accept-Language": "en-US,en;"
}
Upvotes: 4