How to use the contentType sent by the client on the server

0

Good afternoon! I'm trying to understand the function of contentType. As far as I know, I would be telling the server to use the formed JSON UTF8 to properly encode the data I am sending. contentType: "application/json; charset=utf-8", If correct, I still have to know how to use this information. So far I figured it would be including the header.

header('Content-Type: text/html; charset=utf-8');
header('Content-Type: text/json; charset=utf-8');

In this case, if it is correct, there is some other problem because I can not get it to work.

Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response.
    
asked by anonymous 07.07.2016 / 20:08

0 answers