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

curl-and-php

Re: (no subject)

From: Michael Wallner <mike_at_iworks.at>
Date: Wed, 28 Dec 2005 10:04:21 +0100

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,

-- 
Michael - <mike(@)php.net> http://dev.iworks.at/ext-http/http-functions.html.gz
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2005-12-28