[英]CURL Rest POST endpoint without requestbody
Is there any simple way of curl a REST API POST endpoint without a request body? 没有请求主体,是否有任何简单的卷曲REST API POST端点的方法? For some reason, the API i am working with is using a endpoint as POST even though its an obvious GET.
出于某种原因,我正在使用的API使用端点作为POST,即使它是明显的GET。 No Request or HTTP parameters should be added to the request.
不应将请求或HTTP参数添加到请求中。
The response i get when i do: 当我这样做时得到的响应:
curl -i -X POST https://APIURL is: <BODY><h2>Length Required</h2> <hr><p>HTTP Error 411. The request must be chunked or have a content length.</p> </BODY>
向您的curl请求添加content-length标头,因为它强制向其提供请求。
-H "Content-Length: 0"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.