# Translating from curl to uri: where do I put the -F filename parameter?

**URL:** <https://forum.ansible.com/t/translating-from-curl-to-uri-where-do-i-put-the-f-filename-parameter/19039>\
**Category:** Ansible Project\
**Created:** [August 17, 2015, 11:16pm UTC](https://forum.ansible.com/t/translating-from-curl-to-uri-where-do-i-put-the-f-filename-parameter/19039 "2015-08-17T23:16:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Larry\_Fast](https://avatars.discourse-cdn.com/v4/letter/l/b3f665/32.png) [@Larry\_Fast](https://forum.ansible.com/u/Larry_Fast)\
**Post date:** [August 17, 2015, 11:16pm UTC](https://forum.ansible.com/t/translating-from-curl-to-uri-where-do-i-put-the-f-filename-parameter/19039/1 "2015-08-17T23:16:15Z")

</div>

I’m trying to convert the following curl POST command into an Ansible uri: Task.  
curl -F upload\_file=@my\_datafile.xml http://my\_destination

At the http end I’m trying to respond to the following page:

getting the file contents into the Post seems easy enough but where do I stuff “upload\_file” parameter? Will I need to construct the whole POST body via a template?

A dump of the curl comms shows:

0000: POST /my\_destination HTTP/1.1  
0037: User-Agent: curl/7.40.0  
0050: Host: 10.128.17.41  
0064: Accept: _/_  
0071: Content-Length: 191705  
0089: Expect: 100-continue  
009f: Content-Type: multipart/form-data; boundary=--------------------  
00df: ----5357ae70294501c5  
00f5:  
\<= Recv header, 23 bytes (0x17)  
0000: HTTP/1.1 100 Continue  
=\> Send data, 177 bytes (0xb1)  
0000: --------------------------5357ae70294501c5  
002c: Content-Disposition: form-data; name=“upload\_file”; filename=“es  
006c: 1-msg-hello-bye-20150816151607.xml”  
0090: Content-Type: application/xml  
00af:  
=\> Send data, 16384 bytes (0x4000)  
0000: \<?xml version="1.0" encoding="UTF-8"?\>.……\<timest  
0040: amp\>2015-08-16 15:16:07…32333036-3935-584D-5  
0080: 133-303330313836…es1-msg-hello-bye.  
00c0: …\<man\_ip\_address\>33.21.15.23\</man\_ip\_address\>
