File tree Expand file tree Collapse file tree 4 files changed +5
-4
lines changed
Expand file tree Collapse file tree 4 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ users can simply use the following pattern:
105105.. code-block :: python
106106
107107 r = client.some_endpoint()
108- assert r.status_code == 200 , r.raise_for_status()
108+ assert r.status_code == httpx.codes. OK , r.raise_for_status()
109109 data = r.json()
110110
111111 The API indicates errors using the response status code, and this pattern will
Original file line number Diff line number Diff line change @@ -430,7 +430,7 @@ You can identify on which exchange a symbol is listed by using
430430.. code-block :: python
431431
432432 r = c.search_instruments([' GOOG' ], projection = c.Instrument.Projection.FUNDAMENTAL )
433- assert r.status_code == 200 , r.raise_for_status()
433+ assert r.status_code == httpx.codes. OK , r.raise_for_status()
434434 print (r.json()[' GOOG' ][' exchange' ]) # Outputs NASDAQ
435435
436436 However, many symbols have order books available on these streams even though
Original file line number Diff line number Diff line change 2828 # Assume client and order already exist and are valid
2929 account_id = 123456
3030 r = client.place_order(account_id, order)
31- assert r.status_code == 200 , raise_for_status()
31+ assert r.status_code == httpx.codes. OK , r. raise_for_status()
3232 order_id = Utils(client, account_id).extract_order_id(r)
3333 assert order_id is not None
3434
Original file line number Diff line number Diff line change 44import asyncio
55import copy
66import datetime
7+ import httpx
78import inspect
89import json
910import logging
@@ -344,7 +345,7 @@ async def login(self):
344345 r = self ._client .get_user_principals (fields = [
345346 self ._client .UserPrincipals .Fields .STREAMER_CONNECTION_INFO ,
346347 self ._client .UserPrincipals .Fields .STREAMER_SUBSCRIPTION_KEYS ])
347- assert r .status_code == 200 , r .raise_for_status ()
348+ assert r .status_code == httpx . codes . OK , r .raise_for_status ()
348349 r = r .json ()
349350
350351 await self ._init_from_principals (r )
You can’t perform that action at this time.
0 commit comments