Using Python-requests
I was trying to access an API using Python-requests.
When I try this:
url = "http://domain.com"
data = {'field': 'project_id', 'op' : 'eq', 'value' : 'some value'}
r = r.requests(url, params=data)
I could get an API response with the project id specified.
But if I try to pass parameters with the same parameters name with
different value, it cancelled out the first params (project_id):
data = {
'field': 'project_id', 'op' : 'eq', 'value' : 'some value',
'field': 'event_type', 'op' : 'eq', 'value' : 'some event_type'
}
I could get an API response with specified event_type only.
API accepts multi-parameters name, but i just dont know how to do it in
python requests.
I would like to know if I am able to do it using python requests or should
I use different one.
No comments:
Post a Comment