I was writing some ruby scripts to do eBay file exchange. The http post kept getting 302 response, and redirecting to the http://pages.ebay.com/messages/page_not_responding.html?eBayErrorEventName=...
searching for it returned heaps other posts on ebay forum reporting similar problem, with no solution
After a few hours' struggle, finally I figured it out.
Using programmatic instructions to upload files to eBay file exchange requires the initiate an HTTPS connection and then post the data file with token to the ebay file exchange web address: http://bulksell.ebay.com/ws/eBayISAPI.dll?FileExchangeUpload
In my original script, I constructed a URI object
url = 'https://bulksell.ebay.com.au/ws/eBayISAPI.dll?FileExchangeUpload'
uri = URI.parse(url)
newed a http session
http = Net::HTTP.new(uri.host, uri.port)
http.start {
then did the http post
http.post(uri.path, query, headers)
The problem was with the uri.path, which only contained the "/ws/eBayISAPI.dll" after URI.parse, the query string "FileExchangeUpload" was stripped.
I solved it finally by doing this:
postPath = uri.path + "?" + uri.query
http.post(postPath, query, headers)
Print | posted on Monday, November 26, 2007 11:39 PM