I’ve programmed a Http server in Node.js using Express. It’s listening on port 3000.
I’m trying to send the following http POST command from Xojo:
sPost = "http://127.0.0.1:3000/levelz?band_type=pottier"
result = HTTPSocket1.Post(sPost,0)
So that band_type = pottier is identified in the body (req.body in Node.js). It’s worth noting that req._body is FALSE when I debug my Node.js app but when I use POSTMAN to submit the same command it passes through without problems (means req.body = “band_type”:“pottier”} with req._body: true
It seems me error is that in my code above the “band_type=pottier” is identified as URL params (that’s how it’s named in POSTMAN) and thus not identified as a key:value pair of body.
How can I change the command to reflect this? I’ve tried EndOfLine and leaving a space but to no avail. I can’t find the exact specification of what kind of characters are used in the command to “show” to the Http server that the next portion of the command is the body (at least not in POST).
Thanks in advance,
Andreas