-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch back to default Faraday encoder and change list-records call to POST #96
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
require 'uri' | ||
require_relative 'query_string' | ||
require_relative 'faraday_rate_limiter' | ||
|
||
module Airrecord | ||
|
@@ -21,9 +19,7 @@ def connection | |
headers: { | ||
"Authorization" => "Bearer #{api_key}", | ||
"User-Agent" => "Airrecord/#{Airrecord::VERSION}", | ||
"X-API-VERSION" => "0.1.0", | ||
}, | ||
request: { params_encoder: Airrecord::QueryString } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Turns out this isn't the case anymore (checked various examples in the API docs). And interestingly, it caused a bizarre issue with our list-records call where increasing the Superseding all of this is the fact that this PR is switching the list-records call to POST, which also fixes our issue. But seems worth it to stop maintaining a custom encoder if we don't have to. |
||
) do |conn| | ||
if Airrecord.throttle? | ||
conn.request :airrecord_rate_limiter, requests_per_second: AIRTABLE_RPS_LIMIT | ||
|
@@ -33,7 +29,7 @@ def connection | |
end | ||
|
||
def escape(*args) | ||
QueryString.escape(*args) | ||
CGI.escape(*args) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This used to be |
||
end | ||
|
||
def parse(body) | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,8 +76,8 @@ def records(filter: nil, sort: nil, view: nil, offset: nil, paginate: true, fiel | |
options[:maxRecords] = max_records if max_records | ||
options[:pageSize] = page_size if page_size | ||
|
||
path = "/v0/#{base_key}/#{client.escape(table_name)}" | ||
response = client.connection.get(path, options) | ||
path = "/v0/#{base_key}/#{client.escape(table_name)}/listRecords" | ||
response = client.connection.post(path, options.to_json, { 'Content-Type' => 'application/json' }) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The conversion to POST as per the notes in #95 |
||
parsed_response = client.parse(response.body) | ||
|
||
if response.success? | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive-by, this is no longer required and is out of date.