Python HTTP POST Osmand live track

264 Views Asked by At

I am trying to send HTTP POST to traccar from a python application. How can i use requests to send it in the following format (osmand):

http://demo.traccar.org:5055/?id=123456&lat={0}&lon={1}&timestamp={2}&hdop={3}&altitude={4}&speed={5}

Requests post syntax= requests.post(url, params={key: value}, args)

It works great when i use cURL.

Any one having any ideas?

Thanks

1

There are 1 best solutions below

0
On

For POST you should use body instead of query parameters. You should be able to send it with something like this

requests.post('http://demo.traccar.org:5055', data = {'lat': y, 'lon': x})