diff options
Diffstat (limited to 'lib/bulk_imports/clients')
-rw-r--r-- | lib/bulk_imports/clients/http.rb | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/bulk_imports/clients/http.rb b/lib/bulk_imports/clients/http.rb index 037da5e0816..1d77757c4af 100644 --- a/lib/bulk_imports/clients/http.rb +++ b/lib/bulk_imports/clients/http.rb @@ -35,7 +35,7 @@ module BulkImports end def each_page(method, resource, query = {}, &block) - return to_enum(__method__, method, resource, query) unless block_given? + return to_enum(__method__, method, resource, query) unless block next_page = @page @@ -101,22 +101,19 @@ module BulkImports def default_options { - headers: request_headers, - follow_redirects: false + headers: { 'Content-Type' => 'application/json' }, + query: request_query, + follow_redirects: true, + resend_on_redirect: false, + limit: 2 } end def request_query { page: @page, - per_page: @per_page - } - end - - def request_headers - { - 'Content-Type' => 'application/json', - 'Authorization' => "Bearer #{@token}" + per_page: @per_page, + private_token: @token } end |