Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy is curl sending the command-line before the message body in an HTTP PUT?
    text
    copied!<p>I'm issuing the command (line broken for readability):</p> <pre><code>curl -H"X-RequestIsAbsolutePath: F" \ -T /tmp/out \ -H'Content-Type: application/xml' \ "http://localhost:8182/metadata/036-Rotated.JPG" </code></pre> <p>I'm sending a message body of XML. I get a complaint from the XML parser on the server about content not being allowed in the prolog. I added a --trace-acii option to the command line and see:</p> <pre>=> Send header, 270 bytes (0x10e) 0000: PUT /metadata/036-Rotated.JPG HTTP/1.1 0028: User-Agent: curl/7.19.4 (i386-apple-darwin9.6.0) libcurl/7.19.4 0068: OpenSSL/0.9.8i zlib/1.2.3 0083: Host: localhost:8182 0099: Accept: */* 00a6: X-RequestIsAbsolutePath: F 00c2: Content-Type: application/xml 00e1: Content-Length: 235 00f6: Expect: 100-continue 010c: == Info: Done waiting for 100-continue => Send data, 235 bytes (0xeb) 0000: curl -v -H"X-RequestIsAbsolutePath: F" "http://localhost:8182/me 0040: tadata/036-Original.JPG".&lt;metadata>. &lt;Core>. &lt;ImageOrientati 0080: on editable="1" type="unsignedShort">. &lt;value raw="3"/>. 00c0: &lt;/ImageOrientation>. &lt;/Core>.&lt;/metadata>.</pre> <p>Why is curl sending the command-line itself as part of the message body? Of course the XML parser will complain. How can I get curl to stop doing that and send only the contents of the file passed as an argument to the -T option?</p> <p>FYI: I've captured the raw text being sent on the server and, yes, the command-line really is being sent. FYI#2: I'm using the latest curl (7.19.4) on Mac OS X.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload