i have an Api function in Golang that receive a json data and good working with postman but i want te call api with python3 but error in parse body this is my golang code:
var approve bson.M
err := c.BodyParser(&approve)
and this is my data in patch api :
{
"result" : true
}
and this is my python script:
jsondata = bson.BSON.encode({'result': True})
options = CodecOptions(document_class=collections.OrderedDict)
#decoded_doc = bson.BSON(jsondata).decode(codec_options=options)
decoded_doc = bson.decode(jsondata, codec_options=options)
r = requests.patch(approvurl,data=decoded_doc,headers={'Content-Type':'application/json','Authorization':API_KEY,'Imei':'1234567890','phone':'123456789','email':'test@gmail.com'} )
and my backend in my golang throw this exeption :
expected { character for map value
and i compare json object in wirshark : this is for postman: enter image description here and this is for my python script enter image description here
please help me to solve my problem in python script