#Send checkbox using multipart/form-data
7 messages · Page 1 of 1 (latest)
Help is on the way! To mark it as solved, use the /solve command. In the meantime, here are some existing threads that may help you:
Documentation:
I just looked into how the Admin does this and it just sends anything but the file as a JSON string inside the _payload field. Is this a documented feature?
Hey @snow pewter!
Did you find a solution to your problem?
I try this but it doesn't work:
response = requests.post(
url,
headers={"Authorization": f"users API-Key {payload_api_key}"},
files={"file": (filename, image_content, "image/jpeg")},
json={"_payload": {"productIdAlpha": product_id_alpha}},
)
Ah it's:
url,
headers={"Authorization": f"users API-Key {payload_api_key}"},
files={
"file": (filename, image_content, "image/jpeg"),
"productIdAlpha": (None, product_id_alpha),
},
)