curl-and-php
Re: requests with bodies
Date: Fri, 26 Jul 2002 13:19:14 +0200 (MET DST)
On Sun, 7 Jul 2002, bill mill wrote:
> my question is this: Is it possible to use Curl to send requests (propfind
> requests in my case) that include bodies?
Yes it is.
> Basically, I would like to send some xml in the body of a request, and I'm
> curious if it is possible with Curl. The code in Perl looks like:
>
> use LWP::UserAgent;
>
> $self->{ua} = new RequestAgent;
> $self->{ua}->cookie_jar(new HTTP::Cookies);
> $self->{ua}->set_user($self->{user}, $self->{passwd});
>
> my $req = new HTTP::Request(PROPFIND => $self->{server});
> $req->content_type("text/xml");
> $req->content($findinitfolders); //here is the line i'm trying to emulate
>
> I don't write Perl, I'm trying to translate this code into PHP using Curl,
> and that's where I stumbled. Thanks for any help.
Something like this is what you want:
curl --header "Content-Type: text/xml" --data "send this in the body"
--request "PROPFIND" [URL]
-- Cheers, Daniel Stenberg ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sfReceived on 2002-07-26