Guest User

Untitled

a guest
Aug 9th, 2012
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. Connect to eBay API sandbox site with ruby
  2. require 'net/http'
  3.  
  4. path = '/ws/api.dll'
  5. req = '<XML request here>'
  6. header = 'HEADERS here'
  7.  
  8. http = Net::HTTP.new("api.sandbox.ebay.com")
  9. http.use_ssl = true
  10. http.verify_mode = OpenSSL::SSL::VERIFY_NONE
  11.  
  12. resp = http.post(path, req, header)
  13. puts resp
  14.  
  15. ruby -v
  16. ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
  17.  
  18. /home/alex/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:762:in `initialize': Connection timed out - connect(2) (Errno::ETIMEDOUT)
  19. from /home/alex/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:762:in `open'
  20. from /home/alex/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:762:in `block in connect'
  21. from /home/alex/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
  22. from /home/alex/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
  23. from /home/alex/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:762:in `connect'
  24. from /home/alex/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
  25. from /home/alex/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:750:in `start'
  26. from ./ebay.rb:91:in `<main>'
Advertisement
Add Comment
Please, Sign In to add comment