cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Command Line POST question

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 1 Jul 2008 19:57:10 -0700

On Tue, Jul 01, 2008 at 03:33:52PM -0700, Ki wrote:
> hi all,
> I need to POST an xml doct to a url using "POST /wctp http/1.1" method.
>
> how do i do this using the command line?
>
> when send with option "-X POST /wctp http/1.1"
>
> i get the error: curl: (3) <url> malformed
> curl: (6) Could not resolve host: HTTP; Host not foun
> <HTML><HEAD><TITLE>Method Not Allowed</TITLE></HEAD>
> <BODY><H1>Method Not Allowed</H1>
> An error has occurred.
> </BODY></HTML>
>
> and when i send: -X "POST /wctp HTTP/1.1" i get:
> <HTML><HEAD><TITLE>Bad request</TITLE></HEAD>
> <BODY><H1>Bad request</H1>
> Your browser sent a query this server could not understand.
> </BODY></HTML>
>
> it appears that cURL only allow sending using a generic POST which
> defaults to HTTP/1.1. any way to tweak this?

The -X option very, very seldom required. You generally only need the
-d or -F option to do POSTs.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2008-07-02