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>