I have created a javascript library and I am setting manually the Content-Type right now. I would love to know what is the default Content-Type. The XHR documentation for the send() method is confusing at best:
4. If body is null, go to the next step. Otherwise ...
BodyInit
If body is a string, set encoding to
UTF-8
.Set request body and Content-Type to the result of extracting body.
Where, the result of extracting body for a text is:
- Blob
- BufferSource
- FormData
- URLSearchParams
- USVString
So, which of these types would it be? The body
passed to send()
is in the default, escaped format of a=b&c=d
. Is it a URLSearchParams
? or a USVString
? or a Blob
? There's a description on each one but it's too cryptic for me to understand (I only know that it's probably not a FormData).
Note: please provide some official documentation if possible