I use postman to send POST requests. I use form fields and I have a field "data". In these field I paste the complete content of a xml-file. It work fine!
Now I want use CURL to send this POST request with dynamic XML-content. But I looking for a simple way to fill the XML content in the field "data" on CURL command.
I try:
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" --data "data=@/my/file/path" http://localhost:3001/import/myservice
If I check the request in my nodejs code there is no content in request params only the filename.
My node code is:
router.post('/import/myservice', function(req, res) {
let data = req.body.data;
... }
Content of data is "@/my/file/path" but I need something like
data= '<?xml version="1.0" encoding="ISO-8859-1"?> ...'