0
Good afternoon! I am trying to understand the workings of contenttype.
As far as I know, I would be telling the server to use the formed JSON UTF8 to correctly encode the data I am sent. contentType: "application/json; charset=utf-8",
If I am correct, I still have to know how to use this information. Until now I imagined that it would be including the header.
header('Content-Type: text/html; charset=utf-8');
header('Content-Type: text/json; charset=utf-8');
In that case, if I’m right, there’s some other problem, because I can’t make it work.
Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response.
What is the difference between this question and the other?
– Sergio
If you answer that question, you’ll see the difference. You agreed with my statements I believe, because you deviated from the topic, correct ?
– willian rodrigues andrade
Willian didn’t understand what you mean by "you shifted the focus from the topic". The idea of my question was to try to make these questions as specific as possible to be really different questions. While I’m not sure if you understand what CORS is and what that mistake you’re getting means.
– Sergio
Sorry. What I want to know is how Contenttype works. I believe it is a guideline for the server to know how to interpret the data it is receiving. Sorry, I don’t know what CORS is.
– willian rodrigues andrade
This is a problem that I am facing and I am unable to solve. I am now believing that Content-Type is my solution. My API can receive both XML and JSON.
– willian rodrigues andrade
I just don’t know how to identify one or the other.
– willian rodrigues andrade