如何通过带cookie的RESTAPI使用CURL命令发送文件?
在使用RESTAPI时,我无法使用Curl命令发送cookie。 通过使用RESTAPI,我们试图上传/发送一个文件到服务器 VVIMP:邮递员也一样 我们尝试了以下CURL命令:如何通过带cookie的RESTAPI使用CURL命令发送文件?,rest,api,curl,file-upload,multipartform-data,Rest,Api,Curl,File Upload,Multipartform Data,在使用RESTAPI时,我无法使用Curl命令发送cookie。 通过使用RESTAPI,我们试图上传/发送一个文件到服务器 VVIMP:邮递员也一样 我们尝试了以下CURL命令: curl -X POST https://serversite.com:443\apipath -H "accept: application/xml" -H "accept-encoding: gzip, deflate, br" -H "accept-language: en-GB,en-US;q=0.9,en;
curl -X POST https://serversite.com:443\apipath -H "accept: application/xml" -H "accept-encoding: gzip, deflate, br" -H "accept-language: en-GB,en-US;q=0.9,en;q=0.8" -H "cache-control: no-cache" -H "connection: keep-alive" -H "content-type: multipart/form-data" -H "origin: https://serversite.com:443" -H "user-agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36" -c "Cookie: _app_vis_id_=790FC6B0F5AE014A5E52A8B162CC129B" -F "file=C:\temp\upload.txt" -F "param1=value1" -F "param2=value2" >> "C:\temp\myfile.txt"
我们得到以下服务器响应:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<result>
<header>
<code>Rj209</code>
<message>Session not found</message>
</header>
</result>
Expected response is:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<result>
<header>
<code>Rj200</code>
<message>Success</message>
</header>
<body>
<data>
<items>
<item>
<objectType>SHARE_FILE</objectType>
<keyValue>
<key>id</key>
<value>52</value>
</keyValue>
<keyValue>
<key>version</key>
<value>4</value>
</keyValue>
</item>
</items>
</data>
</body>
</result>