// Detecting streaming request support works like this:
// If the browser doesn't support a particular body type, it calls toString() on the object and uses the result as the body.
// So, if the browser doesn't support request streams, the request body becomes the string "[object ReadableStream]".
// When a string is used as a body, it conveniently sets the Content-Type header to text/plain;charset=UTF-8.
// So, if that header is set, then we know the browser doesn't support streams in request objects, and we can exit early.
// Safari does support streams in request objects, but doesn't allow them to be used with fetch, so the duplex option is tested, which Safari doesn't currently support.
// See https://developer.chrome.com/articles/fetch-streaming-requests/
mono_assert(header_names&&header_values&&Array.isArray(header_names)&&Array.isArray(header_values)&&header_names.length===header_values.length,"expected headerNames and headerValues arrays");