Hi Matt, I followed the steps in the section and tried several combinations of it and still get this message or something similar -
"msg": "value of the body_format must be one of: form-urlencoded, json, raw, got: form-multipart" *note: this is the body section of the URI module/task - file1: filename: "somefilename.bin" mime_type: application/octet-stream todo: "dosomething" *But when I decide to use the SHELL module and the curl command it works - curl -X POST --url https://someaddress/worktodo -k -H 'Accept-Type: application/json' \ -H 'Content-Type: multipart/form-data' \ -H 'Cookie: 'somecookie' \ -F 'todo=dosomething' -F 'binaryfile=@somefilename.bin' On Wednesday, May 19, 2021 at 11:53:06 AM UTC-4 ma...@sivel.net wrote: > It sounds like you are trying to do a multipart post. In which case, just > use body, and follow the example named "Upload a file via > multipart/form-multipart" > > > https://docs.ansible.com/ansible/latest/collections/ansible/builtin/uri_module.html > > On Wed, May 19, 2021 at 10:49 AM Wilber H <wilbe...@gmail.com> wrote: > >> Hi, >> >> URI module cannot use body and src together. >> Binary file and body parameter cannot be posted. >> I've tried to make this work but can't find any Ansible documentation >> stating how to do this using the URI module. I'm able to use curl with the >> SHELL module, but not ideal approach. >> Any guidance would be appreciate it. >> >> >> Regards, >> Wilber H >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ansible Development" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to ansible-deve...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-devel/6c4481bf-f132-42f5-9f3a-15bf9f7dc9efn%40googlegroups.com >> >> <https://groups.google.com/d/msgid/ansible-devel/6c4481bf-f132-42f5-9f3a-15bf9f7dc9efn%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > > > -- > Matt Martz > @sivel > sivel.net > -- You received this message because you are subscribed to the Google Groups "Ansible Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-devel/a37daff6-41ec-4bd4-88bd-1e934de349edn%40googlegroups.com.