async
async copied to clipboard
Posting a form
Hi,
There are no examples of how to use http_post to POST with content_type = multipart/form-data... I'm wondering how to format the structure of the form data and how to modify the headers to reflect the right request body.
Thanks!
To be explicit, I want to do pretty much edit the http_post code to do this on the existing handle:
handle_setform(handle, OPTION1 = VALUE, OPTION2 = VALUE, ...)
I don't know how to do this with just postfields.
Yes, the current approach is not great, and maybe it should let you simply pass in a handle for a request. OTOH, an easier fix might be to add a form_options argument to http_post(). Do you want to subnit a PR?
Sure thing. I'll add handle to both http_get and http_post and form_data to the latter.
Maybe form_data is enough for now? Thanks!