Send plain text over XMLHttpRequest to Express server
I noticed that you tried plain/text
, but that is incorrect, the correct header is text/plain
.
from MDN
- using the POST method and setting the enctype attribute to
application/x-www-form-urlencoded
(default);- using the POST method and setting the enctype attribute to
text/plain
;- using the POST method and setting the enctype attribute to
multipart/form-data
;- using the GET method (in this case the enctype attribute will be ignored).
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest