Send form data from Tornado HTTPClient

How can I use the fetch method to send multipart form data in a POST request? I don't see this mentioned in the documentation anywhere.

I tried this, but the arguments on the server (HTTPServerRequest.arguments) were empty:

client.fetch(
    '/foo/bar',
    headers={'Content-Type': 'form-data'},
    body=urllib.parse.urlencode({'a': 1, 'b': 2})
)


Read more here: https://stackoverflow.com/questions/66271594/send-form-data-from-tornado-httpclient

Content Attribution

This content was originally published by shadowtalker at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: