ruby on rails - Download a zip file from eBay using rest-client -
i want download zip file ebay. using downloadfile
api.
response = restclient.post(url,xml,headers)
this call return content of zip file not exractable in xml think. want download zip file ebay.
my code is:
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>'
the documentation api used above can found here : http://developer.ebay.com/devzone/file-transfer/callref/downloadfile.html
you have pass content of response library rubyzip. use extract files zipped file. can first writing file disk, , reading using rubyzip.
specifically @ part of documentation of rubyzip - reading zip file accomplish trying achieve.
Comments
Post a Comment