带有卷曲的POST而不发送数据 [英] POST with curl without sending data

查看:64
本文介绍了带有卷曲的POST而不发送数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用curl发送POST请求而不发送任何数据?

Is there a way to use curl to send a POST request without sending any data?

我们通常发布以下内容:

We usually post like:

curl --data @C:\mydata.txt http://1.2.3.4/myapi

如果省略-data ,则表示正在执行GET。

If you omit the --data you are doing a GET. How can you omit it and still do a POST?

推荐答案

随机找到解决方案在另一则帖子上:

Randomly found the solution on another post:

curl -X POST http://example.com

这篇关于带有卷曲的POST而不发送数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆