Rest Api calling using python requests package

As explained in this link (How to receive data from a POST request in frappe)

i am also trying same way but i don’t know why its not working. i am trying for method which have parameter .

my api method code is:

def sps_erpnext_rest_api(filters):
print"@@@@@@@ filter @@@@@@@@@", filters, type(filters)
if filter is not None:
q= “”“select * from tabxyz where name= ‘%s’”"" %(str(filters[0][‘name’]))
else: q= “”" select * from tabxyz“”"
print"@@@@@@@@@@ REST Called @@@@@@@@@@@@@@@@",
return k

And api calling code is:

import request, json
head= { “Content-type”: “application/json”}
my_params= [{‘name’: ‘TTTT5’}]
url= “
response=, data=json.dumps(my_params) )
print response

In error am getting sps_erpnext_rest_api() takes 1 argument 0 is given.

when am trying sps_erpnext_rest_api() without any parameter its working fine.

So can you guys help me how to bind parameters

Thanks and regards

def sps_erpnext_rest_api(filters=None):

thank you for your valuable time sir.

Sir but i am passing value to filters when am calling sps_erpnext_rest_api() this function.
Then why i am getting error sir?

Thanks and regards

its not working sir. its taking None as value.

‘name’ is not the parameter name, you should write my_params= [{‘filters’: ‘TTTT5’}], as ‘filters’ is the parameter name

my= [{‘filters’: ‘TTTT5’}]
passing this also not working