curl.exe不附加文件体

curl.exe不附加文件体,curl,Curl,我正在windows上执行以下curl命令。执行该命令,但curl不附加文件体。它只写入标题: curl.exe -H "Authorization: Bearer very-secret-stuff" -F file=@E:/almostEmpty.txt --verbose https://to-this-address 已发送请求: POST /api/rest/v5/transientDocuments HTTP/1.1 Host: api.eu1.echosign.com User-

我正在windows上执行以下curl命令。执行该命令,但curl不附加文件体。它只写入标题:

curl.exe -H "Authorization: Bearer very-secret-stuff" -F file=@E:/almostEmpty.txt --verbose https://to-this-address
已发送请求:

POST /api/rest/v5/transientDocuments HTTP/1.1
Host: api.eu1.echosign.com
User-Agent: curl/7.56.1
Accept: */*
Authorization: Bearer very-secret-stuff
Content-Length: 214
Content-Type: multipart/form-data; boundary=------------------------e84a74f3e81c968e

***Nothing here. The file body is actually missing***
HTTP/1.1 400 Bad Request
Date: Wed, 08 Nov 2017 12:28:00 GMT
Server: Apache
x-request-id: 613647cc-c04b-49d7-8b86-62fc65841a8a
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 61
Strict-Transport-Security: max-age=31536000;
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Robots-Tag: none
P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
Connection: close
Content-Type: application/json;charset=UTF-8

{"code":"NO_FILE_CONTENT","message":"Must provide file body"}

Closing connection 0
TLSv1.2 (OUT), TLS alert, Client hello (1):
收到响应:

POST /api/rest/v5/transientDocuments HTTP/1.1
Host: api.eu1.echosign.com
User-Agent: curl/7.56.1
Accept: */*
Authorization: Bearer very-secret-stuff
Content-Length: 214
Content-Type: multipart/form-data; boundary=------------------------e84a74f3e81c968e

***Nothing here. The file body is actually missing***
HTTP/1.1 400 Bad Request
Date: Wed, 08 Nov 2017 12:28:00 GMT
Server: Apache
x-request-id: 613647cc-c04b-49d7-8b86-62fc65841a8a
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0
Content-Length: 61
Strict-Transport-Security: max-age=31536000;
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Robots-Tag: none
P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
Connection: close
Content-Type: application/json;charset=UTF-8

{"code":"NO_FILE_CONTENT","message":"Must provide file body"}

Closing connection 0
TLSv1.2 (OUT), TLS alert, Client hello (1):
根据他们的定义,文档的参数是
文件
,而不是
文件

尝试将cURL命令更改为使用:

-F File=@E:/almostEmpty.txt
还要注意,
--verbose
不会在控制台上显示文件内容,只显示标题和响应标题。正在发送文件,只是表单参数名称错误。

根据他们的说法,文档的参数是
文件
,而不是
文件

尝试将cURL命令更改为使用:

-F File=@E:/almostEmpty.txt
还要注意,
--verbose
不会在控制台上显示文件内容,只显示标题和响应标题。正在发送您的文件,只是表单参数名称错误。

FWIW: 不带连字符的ContentType

正如Drew在上面所说的“File”post字段,大写字母为F: 不带连字符的ContentType


正如Drew在上面所说的“File”post字段,大写字母F

File=@E:/almostEmpty.txt:它不应该是反斜杠“\”?已经尝试了所有组合:File=@E:\almostEmpty.txt File=@E:\\almostEmpty.txt始终是相同的结果,将它放在两个“?不。已经完成-F“file=@E:\almostEmpty.txt”file=@E:/almostEmpty.txt:它不应该是反斜杠“\”?已经尝试了所有组合:file=@E:\almostEmpty.txt file=@E:\\almostEmpty.txt总是相同的结果放在“”之间?不。已完成-F“file=@E:\almostEmpty.txt”