I am trying to create an api which get an json input and convert it into the protocol buffer,but getting error
Parse() missing 1 required positional argument: 'message
here is the api
class Proto(APIView):
def get(self, request, *args, **kwargs):
try:
data={
"name": "Ashutosh",
"age": "26",
"city": "gurgaon",
"phone_number": "9717336958"
}
data = str(data)
parsed_data = json.dumps(ast.literal_eval(data))
#message = Parse(json.dumps(parsed_data))
a = google.protobuf.json_format.Parse(parsed_data)
return Response({'status':'SUCCESS','data':"pending...."},status=200)
except Exception as e:
return Response({'status':'ERROR','message':str(e)})