[英]Switching from CURL to HTTPie. Equivalent of CURL -T
来自 cURL 的手册:
-T, --upload-file <file>
This transfers the specified local file to the remote URL.
看来您正在寻找上传功能。 在 HTTPie 中,根据主机服务器的期望,您可以通过多种方式上传文件:
A)重定向输入:
$ http PUT httpbin.org/put Content-Type:image/png < /images/photo.png
B)从文件名请求数据(自动设置Content-Type
标头):
$ http PUT httpbin.org/put @/images/photo.png
C)表格文件上传:
$ http --form PUT httpbin.org/put photo=@/images/photo.png
Jakub Roztocil的原始答案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.