Sending user message to actions server as a JSON object

hey everyone. I am trying to send the user message from another module to the actions server using the following piece of code.

payload = {'sender':'test_user','message':'plus'}
headers = {'content-type': 'application/json'}
r ='http://localhost:5055/webhook', json=payload, headers=headers)
#r ='http://localhost:5055/webhook', json=payload, headers=headers)

i need a way to store the incoming payload in a variable do that i can do some processing on it. I am unable to find a way to store the incoming string and use it in an action. Please help me here.