Re: Question about HTTP Post
Date: Thu, 13 Dec 2001 13:26:05 +0100 (MET)
On Thu, 13 Dec 2001 christoph.vogler_at_sercon.de wrote:
> I have the following to do, and would like to know if it is possible:
> I have to Post a XML-File to an intranet-server,
> the URL is like:
> The File needs following information:
This is a malformed first line. In requires a space after the POST keyword.
> User-Agent: Java.1.8
> Accept: text(/htmlm image/gif, image/jpeg, *; q=.2, */*;q=.2
> Connection: keep-alive
If you only post one file, do you really need this? This "keep-alive" is by
the way HTTP 1.0-style only.
> Content-lenght: 817
> <?xml version="1.0"encoding="iso-8859-1"?>
You need an empty line between the end of the headers and the start of the
> Can anyone explain me how to Post it with curl, if it is possible, i´ve
> never worked with http posting things :-))
Store the full XML data in a file. Let's call it xml.txt for now:
1. To POST the data specified in the file use "-d @xml.txt"
2. You want that User-Agent header? Use "-A Java.1.8"
3. You need HTTP 1.0 rather than 1.1? Use --http1.0
4. You want that weird Accept: line? Use '-H "Accept: bla bla yada yada"'
5. Set that content-type with '-H "Content-Type:application/x-sap.busdoc"'
6. Append the URL
7. Write all options on one line
8. fire off ;-)
-- Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/Received on 2001-12-13