Re: http_post with data in body
- Posted by jmduro Jan 14, 2017
- 1611 views
I found two methods working with curl:
1) put the json part in a file then call
curl -i -H "Accept: application/json" -H "Content-Type: application/json; charset=UTF-8" -X POST -d @data.json http://127.0.0.1:9515/session
2) Escape quotes in data part
curl -i -H "Accept: application/json" -H "Content-Type: application/json; charset=UTF-8" -X POST -d "{\"desiredCapabilities\": {}}" http://127.0.0.1:9515/session
When run from within Euphoria there will be many more escape chars. As this runs with curl, it should also work with libcurl and probably also with WinHTTP (at least second solution).
Jean-Marc