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"); 
  • If you have the contents of a variable type, place or odil or another title on the situation. But this is not good in the context of a request for 1 URL. Two at once - this is not done, and this is only parsed by crooked servachki) - Goncharov Alexander
  • It seems like both are meaningless, aren't they? - andreymal
  • What sense do you mean I don't understand? Why are both devils meaningless ?? - Maks.Burkov 4:44 pm
  • And how can one content be of two different types? - andreymal
  • one
    For a request of a certain type, the Accept header is used in the server's response - and here you can specify several types in it. The Content-Type header 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

1 answer 1

Actually, I think both are impossible ... How can one content have several types at the same time?