[PHP] Re: Curl Question

2006-01-03 Thread Manuel Lemos

Hello,

on 01/03/2006 06:52 PM Ray Hauge said the following:
I just wanted to see if anyone knew if there was any difference in 
performance between using curl in an exec() statement and when using the 
libCurl functions within PHP.


Executing a separate program should be a little slower as it adds some 
overhead before executing a request. Actually, in some cases it can be a 
little faster to use fsockopen instead of libcurl as it is one less 
library to load.


You may also want to take a look at this HTTP client class that uses 
fsockopen everytime it is possible and only uses libcurl functions in 
certain cases. This class takes care of cookie handling, redirection, 
form posting, file uploading, etc..


http://www.phpclasses.org/httpclient


--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Curl Question

2006-01-03 Thread Ray Hauge

Thanks for the info!

Manuel Lemos wrote:


Hello,

on 01/03/2006 06:52 PM Ray Hauge said the following:

I just wanted to see if anyone knew if there was any difference in 
performance between using curl in an exec() statement and when using 
the libCurl functions within PHP.



Executing a separate program should be a little slower as it adds some 
overhead before executing a request. Actually, in some cases it can be 
a little faster to use fsockopen instead of libcurl as it is one less 
library to load.


You may also want to take a look at this HTTP client class that uses 
fsockopen everytime it is possible and only uses libcurl functions in 
certain cases. This class takes care of cookie handling, redirection, 
form posting, file uploading, etc..


http://www.phpclasses.org/httpclient




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: CURL question, cutting off custom request

2004-08-16 Thread Manuel Lemos
Hello,
On 08/16/2004 12:40 PM, Dominic Schanen wrote:
I'm sending a custom request to a server using CURL, which may contain 
some high-ascii characters. Are there certain characters that would 
cause CURL not to send the complete custom request? Are there some CURL 
options that can help make sure the request is sent in its entirity? 
Here is my code:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_HTTP_VERSION, 1.0);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $request);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$return = curl_exec ($ch);
Sometimes it appears to cutoff my request with the existance of a NUL 
character.

Any ideas?
That depends on where you are using non-ASCII characters. If it is in 
the request headers, you need to use q-encoding to encode them as ASCII. 
If it is in the request body, it should not be a problem, although I 
think you should specify the character set in the Content-Type header.

--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php