【发布时间】:2017-09-12 07:49:13
【问题描述】:
我想从 eBay 下载 zip 文件。使用downloadfile api。
response = RestClient.post(url,xml,headers)
此调用返回我认为在 xml 中不可提取的 zip 文件的内容。所以我想从 eBay 下载 zip 文件。
我的代码是:
headers = {
"X-EBAY-SOA-OPERATION-NAME"=>"downloadFile",
"X-EBAY-SOA-SECURITY-TOKEN" => access_token_lister,
"X-EBAY-API-SITEID"=>"0",
"Content-Type"=>"application/zip"
}
url = 'https://storage.ebay.com/FileTransferService'
xml = '<?xml version="1.0"
encoding="utf-8"?> <downloadFileRequest xmlns="ebay.com/marketplace/services">; <fileReferenceId>6637191637</fileReferenceId> <taskReferenceId>6474385857</taskReferenceId> </downloadFileRequest>'
上面使用的 API 的文档可以在这里找到:http://developer.ebay.com/devzone/file-transfer/CallRef/downloadFile.html
【问题讨论】:
-
如果你想下载一些东西,你应该使用 GET 方法。此外,请显示更多有关您尝试过的代码以及收到的错误消息。我们不会为您编写代码;)
-
@HolgerFrohloff 我已经用代码更新了我的问题,请看一下。
标签: ruby-on-rails rest-client ebay-api