111,097
社区成员




curl -v -X POST https://api.sandbox.paypal.com/v1/customer/disputes/PP-D-27803/provide-evidence \
-H "Content-Type: multipart/related; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" \
-H "Authorization: Bearer Access-Token" \
-F 'input={
"evidences": [
{
"evidence_type": "PROOF_OF_FULFILLMENT",
"evidence_info": {
"tracking_info": [
{
"carrier_name": "FEDEX",
"tracking_number": "122533485"
}
]
},
"notes": "Test"
}
]
};type=application/json' \
-F 'file1=@NewDoc.pdf'
cmd = "curl -v -X POST https://api.paypal.com/v1/customer/disputes/" + dirName + "/provide-evidence "
+ "-H \"Content-Type: multipart/related; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW\" "
+ "-H \"Authorization: Bearer " + token + "\" "
+ "-F 'input={\\\"evidences\\\": [{\\\"evidence_type\\\": \\\"PROOF_OF_FULFILLMENT\\\",\\\"evidence_info\\\": "
+ "{\\\"tracking_info\\\": [{\\\"carrier_name\\\": \\\"" + expressType + "\\\",\\\"tracking_number\\\": \\\"" + expressNo + "\\\"}]},"
+ "\\\"notes\\\": \\\"" + expressTxt + "\\\"}]};type=application/json' "
+ "-F 'file1=@\\\"" + filePng.FullName + "\\\"'";
curl -v -X POST https://api.paypal.com/v1/customer/disputes/PP-D-79024859/provide-evidence -H "Content-Type: multipart/related; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -H "Authorization: Bearer A21AAMsI4ZYkaJbKfvCWwaqXc98PSq71uZoVqhJOzVy-RzLIt76922GcGHmdKIK1MhCPWupKXq1C0Teny49LiCNrH7U4jIs3w" -F 'input={\"evidences\": [{\"evidence_type\": \"PROOF_OF_FULFILLMENT\",\"evidence_info\": {\"tracking_info\": [{\"carrier_name\": \"CN_CHINA_POST_EMS\",\"tracking_number\": \"LZ273548120CN\"}]},\"notes\": \"test\"}]};type=application/json' -F 'file1=@\"C:\Users\Administrator\Desktop\PP\PP-D-79024859\LZ273548120CN.png\"'
c:\Windows\System32>curl -v -X POST https://api.paypal.com/v1/customer/disputes/
PP-D-79024859/provide-evidence -H "Content-Type: multipart/related; boundary=---
-WebKitFormBoundary7MA4YWxkTrZu0gW" -H "Authorization: Bearer A21AAMsI4ZYkaJbKfv
CWwaqXc98PSq71uZoVqhJOzVy-RzLIt76922GcGHmdKIK1MhCPWupKXq1C0Teny49LiCNrH7U4jIs3w"
-F 'input={\"evidences\": [{\"evidence_type\": \"PROOF_OF_FULFILLMENT\",\"evide
nce_info\": {\"tracking_info\": [{\"carrier_name\": \"CN_CHINA_POST_EMS\",\"trac
king_number\": \"LZ273548120CN\"}]},\"notes\": \"test\"}]};type=application/json
' -F 'file1=@\"C:\Users\Administrator\Desktop\PP\PP-D-79024859\LZ273548120CN.png
\"'
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 64.4.249.23...
* TCP_NODELAY set
* Connected to api.paypal.com (64.4.249.23) port 443 (#0)
> POST /v1/customer/disputes/PP-D-79024859/provide-evidence HTTP/1.1
> Host: api.paypal.com
> User-Agent: curl/7.64.1
> Accept: */*
> Authorization: Bearer A21AAMsI4ZYkaJbKfvCWwaqXc98PSq71uZoVqhJOzVy-RzLIt76922Gc
GHmdKIK1MhCPWupKXq1C0Teny49LiCNrH7U4jIs3w
> Content-Length: 223904
> Content-Type: multipart/related; boundary=----WebKitFormBoundary7MA4YWxkTrZu0g
W; boundary=------------------------42e7b79977d3421a
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
< HTTP/1.1 429 Too Many Requests
< Content-Type: application/json
< Content-Length: 128
< Connection: keep-alive
< Date: Wed, 14 Oct 2020 02:05:41 GMT
< Cache-Control: max-age=0, no-cache, no-store, must-revalidate
< Paypal-Debug-Id: e8b878c715d9b
< Strict-Transport-Security: max-age=31536000; includeSubDomains
<
{"name":"RATE_LIMIT_REACHED","debug_id":"e8b878c715d9b","message":"Too many requ
ests. Blocked due to rate limiting.","links":[]}* Connection #0 to host api.payp
al.com left intact
curl: (3) bad range specification in URL position 2:
[{"evidence_type":
^
Note: Unnecessary use of -X or --request, POST is already inferred.
* Could not resolve host: "PROOF_OF_FULFILLMENT","evidence_info"
* Closing connection 1
curl: (6) Could not resolve host: "PROOF_OF_FULFILLMENT","evidence_info"
curl: (3) unmatched brace in URL position 1:
{"tracking_info":
^
curl: (3) bad range specification in URL position 2:
[{"carrier_name":
^
Note: Unnecessary use of -X or --request, POST is already inferred.
* Could not resolve host: "CN_CHINA_POST_EMS","tracking_number"
* Closing connection 2
curl: (6) Could not resolve host: "CN_CHINA_POST_EMS","tracking_number"
curl: (3) unmatched close brace/bracket in URL position 16:
"LZ273548120CN"}]},"notes":
^
curl: (3) unmatched close brace/bracket in URL position 7:
"test"}]};type=application/json'
^
* Closing connection 0
* schannel: shutting down SSL/TLS connection with api.paypal.com port 443
c:\Windows\System32>
using (var httpClient = new HttpClient())
{
using (var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.sandbox.paypal.com/v1/customer/disputes/PP-D-27803/provide-evidence"))
{
request.Headers.TryAddWithoutValidation("Authorization", "Bearer Access-Token");
var multipartContent = new MultipartFormDataContent();
multipartContent.Add(new StringContent("{\n \"evidences\": [\n{\n \"evidence_type\": \"PROOF_OF_FULFILLMENT\",\n \"evidence_info\": {\n \"tracking_info\": [\n {\n \"carrier_name\": \"FEDEX\",\n \"tracking_number\": \"122533485\"\n }\n ]\n },\n \"notes\": \"Test\"\n}\n ]\n}"), "input");
multipartContent.Add(new ByteArrayContent(File.ReadAllBytes("NewDoc.pdf")), "file1", Path.GetFileName("NewDoc.pdf"));
request.Content = multipartContent;
var response = await httpClient.SendAsync(request);
}
}