Class: Amzwish::Services::RestClientWrapper
- Inherits:
-
Object
- Object
- Amzwish::Services::RestClientWrapper
- Defined in:
- lib/amzwish/services/website_wrapper.rb
Instance Method Summary collapse
Instance Method Details
#get(wishlist_id, page) ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/amzwish/services/website_wrapper.rb', line 35 def get(wishlist_id, page) url = generate_url_for_wishlist(wishlist_id) params = { :page => page, :_encoding => 'UTF8', :filter => '3', :sort=> 'date-added', :layout => 'compact', :reveal => 'unpurchased'} RestClient.get( url, :params => params ) do |resp, req, result| raise "could not find wishlist" unless resp.code == 200 resp.body end end |
#post(email) ⇒ Object
29 30 31 32 33 |
# File 'lib/amzwish/services/website_wrapper.rb', line 29 def post(email) r = RestClient.post( WebsiteWrapper::FIND_WISHLIST_URL, "field-name" => email ) do |resp, req, result| {:code => resp.code, :headers=>resp.headers} end end |