hootnot / oanda-api-v20

OANDA REST-V20 API wrapper. Easy access to OANDA's REST v20 API with oandapyV20 package. Checkout the Jupyter notebooks!
MIT License
403 stars 107 forks source link

neworder.py syntax issue #25

Closed WestonShakespear closed 8 years ago

WestonShakespear commented 8 years ago

Line 35 is currently: "api = API(access_token=token)" but it should be: "api = API(access_token=token, headers={"Content-Type": "application/json"})

It also might be a good idea to add: "environment="practice"" so that if somebody executed this program and doesn't notice that it is in a live environment they don't get financially hurt.

hootnot commented 8 years ago

the header is set automatically since #18 , so it is not needed on the client anymore.

"environment='practice'" by default. If you want to access 'live' you need to pass it explicitly. BTW a token for the practice-environment is not valid on the live-environment and vice versa.

So there is no issue here