Skip to content

Solution: Request Parameter Recipient is Missing & keyword json not supported #2

@Chen-Han

Description

@Chen-Han

Hi there, great post, I really enjoyed reading it.
I had a small problem replying messages.
The line #14
requests.post("https://graph.facebook.com/v2.6/me/messages?access_token=" + ACCESS_TOKEN, json=data)
does not work in my case, it seems like python requests module that I am using does not have keyword arg json, also, the request made must contain a Content-Type:Application/json header
other wise, an error reminding request parameter recipient is missing is returned from facebook
this one works

import json
resp = requests.post("https://graph.facebook.com/v2.6/me/messages?access_token=" + ACCESS_TOKEN, data=json.dumps(data), headers={'Content-Type':'Application/json'})

Hope it helps anyone else reading it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions