Skip to content

Instantly share code, notes, and snippets.

@sido378
Last active August 26, 2016 20:15
Show Gist options
  • Save sido378/d0990443d763af88411aeae388e0a0b8 to your computer and use it in GitHub Desktop.
Save sido378/d0990443d763af88411aeae388e0a0b8 to your computer and use it in GitHub Desktop.
## alte lösung, funzt nicht:
data = {
"recipient[id]": recipient_id,
"message[attachment][type]": "image",
"message[attachment][payload][]": ""
}
items = []
for name, value in data.items():
items.append(MultipartParam(name, value))
## alte lösung, neuer versuch, funzt auch nicht:
data = {
"recipient[id]": str(recipient_id),
"message[attachment][type]": "image",
"message[attachment][payload][]": ""
}
items = []
for name, value in data.items():
items.append(MultipartParam(name, value))
## neue lösung, funzt noch nicht:
items.append(MultipartParam("recipient", {"id": recipient_id }))
items.append(MultipartParam("message", {"attachment":{"type":"image", "payload":{}}}))
## neue lösung, jetzt funzts wegen str(recipient_id):
items.append(MultipartParam("recipient", {"id": str(recipient_id) }))
items.append(MultipartParam("message", {"attachment":{"type":"image", "payload":{}}}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment