There are different ways to make an HTTP request with a custom body as text using JavaScript, below are the examples using the fetch
and axios
libraries.
index.tsx277 chars15 lines
index.tsx256 chars13 lines
In both examples, we set the Content-Type
header to text/plain
to indicate that the request body is a plain text.
gistlibby LogSnag