I wanted to know whether it is possible to make a heading in such a way as 1, or is it necessary to write 2 headings as in the 2nd example?
1. xhr.setRequestHeader("Content-Type","application/json;text/plain"); =================================================================== 2. xhr.setRequestHeader("Content-Type", "text/plain"); xhr.setRequestHeader("Content-Type", "application/json");
Acceptheader is used in the server's response - and here you can specify several types in it. TheContent-Typeheader is used to specify the type of data that the client sends (or the server, if this header is present in the server response), and one piece of data can by no means have several types :) - andmal