Major update, primarily to add pagination support.
* Added Reference objects to encapsulate API calls. * Added Result objects to encapsulate API responses. * Changed the return value of APIClient#execute to Result. * Changed the method signature of APIClient#execute to support named params. * Added APIClient#execute! which throws exceptions on error. * Added automatic parsing code to better allow for complex nested structures. * Added error parser. * Added module for pagination in parsers.
This commit is contained in:
1 parent
a656c13862
commit
f336ab34a7
15 files changed
+821
-306
No files matched your search
+7
-4
@@ -447,7 +447,7 @@ HTML
|
||||
method.upcase!
|
||||
request = [method, uri.to_str, headers, [request_body]]
|
||||
request = client.generate_authenticated_request(:request => request)
|
||||
response = client.transmit_request(request)
|
||||
response = client.transmit(request)
|
||||
status, headers, body = response
|
||||
puts body
|
||||
exit(0)
|
||||
@@ -477,10 +477,13 @@ HTML
|
||||
parameters['xoauth_requestor_id'] = options[:requestor_id]
|
||||
end
|
||||
begin
|
||||
response = client.execute(
|
||||
method, parameters, request_body, headers
|
||||
result = client.execute(
|
||||
:api_method => method,
|
||||
:parameters => parameters,
|
||||
:merged_body => request_body,
|
||||
:headers => headers
|
||||
)
|
||||
status, headers, body = response
|
||||
status, headers, body = result.response
|
||||
puts body
|
||||
exit(0)
|
||||
rescue ArgumentError => e
|
||||
|
||||
Reference in new issue
Block a user