cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: (no subject)

From: Jerry Swanson <pmysql_at_gmail.com>
Date: Wed, 28 Dec 2005 10:16:02 -0500

I got respond from curl request.. That page cannot be found. The header
seems correct to me.

What can cause the problem?

Thanks

On 12/28/05, Pierre <junk_at_regne.net> wrote:
>
> Michael Wallner a écrit :
>
> >Hi Jerry Swanson, you wrote:
> >
> >
> >
> >>This code below gives me the following: The parameter is incorrect.
> >>
> >>What is wrong with this code?
> >>
> >><?php
> >>
> >> include 'QI.xml';
> >> $url = "https://www.mywebsite.com/Test ";
> >> $page="/APP.asp";
> >>
> >> $post_string = $request;
> >> $page1="App.asp";
> >> $header = "POST ".$page1." HTTP/1.0 \r\n";
> >>
> >>
> >
> >A space at the end of the request line makes me a bit creepy.
> >
> >
> >
> >> $header = "MIME-Version: 1.0 \r\n";
> >> $header .= "Content-type: application/PTI26 \r\n";
> >> $header .= "Content-length: ".strlen($post_string)." \r\n";
> >> $header .= "Content-transfer-encoding: text \r\n";
> >> $header .= "Request-number: 1 \r\n";
> >> $header .= "Document-type: Request \r\n";
> >> $header .= "Interface-Version: Test 1.4 \r\n";
> >> $header .= "Connection: close \r\n\r\n";
> >> $header .= $post_string;
> >> $ch = curl_init();
> >> curl_setopt($ch, CURLOPT_URL,$url);
> >> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> >> curl_setopt($ch, CURLOPT_TIMEOUT, 4);
> >> curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header);
> >>
> >>
> >
> >CURLOPT_CUSTOMREQUEST lets one set a custom request method,
> >not a complete request message. You may want to have
> >another look at the manual.
> >
> >Regards,
> >
> >
> Hello
> Agreed
>
> use CURLOPT_HTTPHEADER instead of CURLOPT_CUSTOMREQUEST which stands for
> a custom method on the server.
>
> Pierre
>
>
>
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2005-12-28