cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Command Line POST question

From: Ki <ki_at_cloudfactory.org>
Date: Wed, 2 Jul 2008 10:27:40 -0700 (PDT)

well the problem is that the server is expecting "POST /wctp http/1.1"

if just post is used or the -X option not used at all it defaults to POST
http/1.1.

So my question is can you set the -X option using the command line to
"POST /wctp http/1.1"? or is this not possible using the command line for
curl?

On Tue, 1 Jul 2008, Dan Fandrich wrote:

> 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
>
-------------------------------------------------------------------
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