The Response Object
All API methods apart from account()
and
close_all_trades()
return
Response
objects
The response object is a dict
with a few added methods:
- Truth testing returns true when the Response contains an expected status
- __repr__ displays all keys
-
class
async_v20.interface.response.
Response
(data, status, bool, datetime_format)[source]
Bases: dict
A response from OANDA.
Allows dotted attribute access
-
Response.
json
(datetime_format=None)[source]
Return the json equivalent of the response
-
Response.
dict
(json=False, datetime_format=None)[source]
Convert the response to a nested dictionary
Parameters: | json – Convert object attributes to the JSON representation |