Module: Peddler::Helpers::Feeds20210630
- Included in:
- APIs::Feeds20210630
- Defined in:
- lib/peddler/helpers/feeds_2021_06_30.rb
Instance Method Summary collapse
-
#download_result_feed_document(download_url) ⇒ HTTP::Response
Convenience method to download result feed content from a signed download_url provided by get_feed_document.
-
#upload_feed_document(upload_url, feed_content, content_type) ⇒ HTTP::Response
Convenience method to upload feed content to a signed upload_url previously provided by create_feed_document.
Instance Method Details
#download_result_feed_document(download_url) ⇒ HTTP::Response
Convenience method to download result feed content from a signed download_url provided by get_feed_document. This is step 6 of the 6-step Feeds API workflow. See README.md for the complete workflow documentation.
The download_url is signed and provides access to the processed feed results.
33 34 35 36 37 |
# File 'lib/peddler/helpers/feeds_2021_06_30.rb', line 33 def download_result_feed_document(download_url) response = HTTP.get(download_url) Response.decorate(response, parser:) end |
#upload_feed_document(upload_url, feed_content, content_type) ⇒ HTTP::Response
Convenience method to upload feed content to a signed upload_url previously provided by create_feed_document. This is step 2 of the 6-step Feeds API workflow. See README.md for the complete workflow documentation.
The upload_url is signed, the Host and content-type headers must match the signing.
this must match the content-type requested in create_feed_document
20 21 22 23 24 |
# File 'lib/peddler/helpers/feeds_2021_06_30.rb', line 20 def upload_feed_document(upload_url, feed_content, content_type) response = HTTP.headers("content-type" => content_type).put(upload_url, body: feed_content) Response.decorate(response, parser:) end |