The correct way to use Ocamlnet 3 - Http_client.Convenience.http_post

孤街醉人 提交于 2019-12-06 13:35:29

Drop this from post_para, it is not an HTTP Header, OCamlnet will send that automatically for you: "(Request-Line)", "POST /flights/rpc HTTP/1.1".

To send the headers and POST data separately you need to set the headers use set_request_header on the http_call object.

Also the Convenience module in OCamlnet will send the data as application/x-www-form-urlencoded, but I think you need the data sent as is. You can do that by using Http_client.post_raw.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!