Closed littledrumer closed 3 years ago
This actually does work once you follow the instructions here. For anyone else interested in sending plain text in the body of a POST message here is what I did.
Body is a string of data you want to send.
PostRequest post = new PostRequest(APIurl);
post.addHeader("Content-Type", "text/plain");
post.addData(Body);
post.send();
println("Reponse Content: " + post.getContent());
println("Reponse Content-Length Header: " + post.getHeader("Content-Length"));
Is it possible to make a POST request with just plain text? I followed this link to allow for sending JSON and I tried adapting it so I could send text but it did not work.
I am trying to emulate this POST request from postman in Processing.