Rest Api calling using python requests package

As explained in this link (How to receive data from a POST request in frappe - #4 by revant_one)

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:

@frappe.whitelist(allow_guest=True)
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"“”
k=frappe.db.sql(q,as_dict=True)
print"@@@@@@@@@@ REST Called @@@@@@@@@@@@@@@@",
return k

And api calling code is:

import request, json
head= { “Content-type”: “application/json”}
my_params= [{‘name’: ‘TTTT5’}]
url= “http://xxx.xxx.x.xxx:8000/api/method/sps.sps.api.sps_erpnext_rest_api
response= requests.post(url, 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
Vivek

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
vivek

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