Post

import requests

headers = {
'Content-Type': 'application/json',
}

params = (
('userToken', '4oceb92f1sc6p66cf0svrgsoro'),
)

data = '{"sensorId":"58ff93867be12b532d5053f9", "captureTypeName": "IngresoPersonas", "value":"10", "captureDate":"2017-06-09 5:35:30"}'

requests.post('https://bucket.usantotomas.edu.co:8443/api/sensors/58ff93867be12b532d5053f9/captures', headers=headers, params=params, data=data)

#NB. Original query string below. It seems impossible to parse and
#reproduce query strings 100% accurately so the one below is given
#in case the reproduced version is not "correct".

  1. requests.post('https://bucket.usantotomas.edu.co:8443/api/sensors/58ff93867be12b532d5053f9/captures?userToken=4oceb92f1sc6p66cf0svrgsoro', headers=headers, data=data)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License