@@ -221,13 +221,22 @@ def test_api(self):
221221 }
222222 """
223223
224+ # This is an optional feature; you can still make a request without setting it.
225+ custom_headers_map = {"category" : Category .US_STOCK .name }
226+ api .order .add_custom_headers (custom_headers_map )
224227 res = api .order .place_order (stock_order ['account_id' ], ** stock_order ['stock_order' ])
228+ api .order .remove_custom_headers ()
225229 if res .status_code == 200 :
226230 print ('place order res:' , res .json ())
227231 res = api .order .replace_order (stock_order ['account_id' ], ** stock_order ['stock_order' ])
228232 if res .status_code == 200 :
229233 print ('replace order res:' , res .json ())
234+
235+ # This is an optional feature; you can still make a request without setting it.
236+ custom_headers_map = {"category" : Category .US_STOCK .name }
237+ api .order .add_custom_headers (custom_headers_map )
230238 res = api .order .place_order_v2 (stock_order ['account_id' ], stock_order ['stock_order' ])
239+ api .order .remove_custom_headers ()
231240 if res .status_code == 200 :
232241 print ('place order v2 res:' , res .json ())
233242 res = api .order .replace_order_v2 (stock_order ['account_id' ], stock_order ['stock_order' ])
@@ -298,7 +307,11 @@ def test_api(self):
298307 sleep (5 )
299308
300309 # place
310+ # This is an optional feature; you can still make a request without setting it.
311+ custom_headers_map = {"category" : Category .US_OPTION .name }
312+ api .order .add_custom_headers (custom_headers_map )
301313 res = api .order .place_option (account_id , option_new_orders )
314+ api .order .remove_custom_headers ()
302315 if res .status_code == 200 :
303316 print ("place option=" + json .dumps (res .json (), indent = 4 ))
304317 sleep (5 )
0 commit comments