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:
<input type="file" name="upload_file" value="" /></fieldset><p><input type="
submit" name="submit" value="Submit" /></p>

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"?>.<system>..<sys>...<timest
0040: amp>2015-08-16 15:16:07</timestamp>...<uuid>32333036-3935-584D-5
0080: 133-303330313836</uuid>...<hostname>es1-msg-hello-bye</hostname>.
00c0: ..<man_ip_address>33.21.15.23</man_ip_address>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/64bffc51-c32a-496d-a0ae-8c957f30f974%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to