如何传递“ Content-Length”使用Curl Command标头中的值 [英] How to pass "Content-Length" value in header using Curl Command

查看:366
本文介绍了如何传递“ Content-Length”使用Curl Command标头中的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何传递内容长度的信息,例如-header Content-Length:1000 在curl命令中。
我在命令中这样使用它,但没有用

How can I pass content-length eg. --header Content-Length:1000 in curl command. I used it like this in command but it did't work

curl -v -X POST -u "xxx@gmail.com:xxx123" \ 
     --header "Content-Length: 1000" \
     --header "Content-Type: multipart/mixed" \
     --header "X-REQUEST-ID:7fc7d038-4306-4fc5-89c3-7ac8a12a30d0" \
     -F "request={\"bumId\":\"d51f2978-5ce8-4c71-8503-b0ca438741dd\",\"fileType\":\"imageFile\"};type=application/json" \
     -F "file=@D:/file.pdf" \
     "http://localhost:9090/pro/v1/files"

此命令发布文件到使用Jersey Java开发的Web服务

This command posts file to a web services developed in Jersey Java

推荐答案

使用 -d 导致CURL发送 Content-Length:0

Use -d "" causes CURL to send a Content-Length: 0

这篇关于如何传递“ Content-Length”使用Curl Command标头中的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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