Curl -F option and ansible URI module

I’m trying to use ansible’s uri module to mimic curl command, I need to pass options when uploading an XML file. My curl command has number of options passed via -F, --form <name=content>

I haven’t been able to find an equivalent option on Ansible’s docs, any ideas?

Thanks

A form post is just a urlencoded string, and setting a correct header

  • uri:
    method: POST
    body: foo=bar&baz=qux
    headers:
    “Content-Type”: application/x-www-form-urlencoded
    url: “http://httpbin.org/post