Getting HTTPS 307 followed by Http 302

Vishesh
Vishesh edited February 4 in Python client
Im using the git hub client code provided for kite connect. Things were pretty smooth for last 1+ year...

I'm getting the following error when posting a BO

DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "POST /orders/BO HTTP/1.1" 307 0
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): api.kite.trade
DEBUG:urllib3.connectionpool:http://api.kite.trade:80 "POST /orders/bo HTTP/1.1" 301 None
DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "GET /orders/bo HTTP/1.1" 400 92
EXCEPTION IN (LINE 253 "squareoff=squareoff, trailing_stoploss=trailing_stoploss,tag=tag)"): Invalid `order_id`.
Exception in DirectOrder Invalid `order_id`.

The above is console debug - triggered when the python is triggering the following code

kite = get_kite_client()
data = kite.place_order(variety=product, exchange=exchange, tradingsymbol=tradingsymbol,
transaction_type=TransactionType, quantity=quantity, product=product,
order_type=order_type, price=price, trigger_price=trigger_price, stoploss=stoploss,
squareoff=squareoff, trailing_stoploss=trailing_stoploss,tag=tag)


<<data is my variable to store the return value from the API>>
  • sujith
    It seems like you are passing upper case BO for variety. We have always recommended using the lower case values for variety field.
  • sujith
    You can check out documentation here.
  • Vishesh
    This has resolved the issue - thanks. Strange though... BO is what I had been using for over a year now. Thanks once again! much appreciated.
  • sujith
    Recently, we had changed the infrastructure. Nginx by default changes the route to lower case.
    We have now moved to HAProxy wherein the behavior is different.
Sign In or Register to comment.