473,322 Members | 1,538 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

cURL Alternative?

I'm porting some code from C++ to PHP, and the C++ application I'm
porting from uses the cURL library (http://curl.haxx.se/). The library
is used to both make requests to an internal website at my work and to
look at the returned HTTP response codes (200, 401, 404, etc). It then
takes appropriate action, based on the response code that was
returned.

Assuming I was unable to use the cURL library in my PHP code (due to
mostly non-technical reasons), what alternatives do I have to do user
authentication and checking the resulting HTTP response codes? I have
been pointed to the Snoopy class hosted at SourceForge (http://
sourceforge.net/projects/snoopy/), but it cannot handle HTTPS
authentication without the cURL library. Are there native calls
available for me to do this kind of thing? If so, what are they?

Thanks in advance for any help you might be able to provide.

Jonah

Mar 12 '07 #1
3 22258
Jonah Bishop wrote:
Assuming I was unable to use the cURL library in my PHP code (due to
mostly non-technical reasons), what alternatives do I have to do user
authentication and checking the resulting HTTP response codes?
There's the HTTP_Request PEAR library; you could use system() to call a
command-line tool such as "/usr/bin/wget" or "/usr/bin/GET"; or you could
use plain old TCP sockets and your own code to make the requests (as HTTP
is a very simple text-based protocol).

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Mar 12 '07 #2
Hello,

on 03/12/2007 10:47 AM Jonah Bishop said the following:
I'm porting some code from C++ to PHP, and the C++ application I'm
porting from uses the cURL library (http://curl.haxx.se/). The library
is used to both make requests to an internal website at my work and to
look at the returned HTTP response codes (200, 401, 404, etc). It then
takes appropriate action, based on the response code that was
returned.

Assuming I was unable to use the cURL library in my PHP code (due to
mostly non-technical reasons), what alternatives do I have to do user
authentication and checking the resulting HTTP response codes? I have
been pointed to the Snoopy class hosted at SourceForge (http://
sourceforge.net/projects/snoopy/), but it cannot handle HTTPS
authentication without the cURL library. Are there native calls
available for me to do this kind of thing? If so, what are they?
You may want to try this HTTP client class. It can handle HTTPS without
Curl as it uses the fsockopen call to establish HTTP connections. It
also supports many types of authentication including Basic, Digest, NTLM
(Windows or Samba).

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/
Mar 13 '07 #3
NC
On Mar 12, 6:47 am, "Jonah Bishop" <jgbis...@gmail.comwrote:
>
Assuming I was unable to use the cURL library in my PHP
code (due to mostly non-technical reasons), what alternatives
do I have to do user authentication and checking the resulting
HTTP response codes?
The good old fsockopen(). You can send raw HTTP headers and receive
responses, just like browsers do. If you have OpenSSL enabled, you
can do HTTPS just as easily. For a simple example, see my old post to
alt.php:

http://groups.google.com/group/alt.p...61757c923ebf40

Cheers,
NC

Mar 13 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Haluk Durmus | last post by:
Hello I checked out openssl,mm,apr,apr-util,apache 2,curl,libxml and php from cvs. php couse an ERROR I did the following steps:
8
by: mrbog | last post by:
1. In order to make an http (or https) request with PHP, I need to recompile php with cURL. 2. In order to install CURL I have to upgrade my openssl rpm, even though I'm runing a version of...
3
by: Chris Fortune | last post by:
# uname -a Linux stargate.mxc-online.net 2.4.20-021stab022.2.777-smp #1 SMP Wed Jul 28 17:12:37 MSD 2004 i686 i686 i386 GNU/Linux I recompiled PHP with mcrypt, openssl, and curl phpinfo():...
3
by: Hans | last post by:
Hi everybody, I am desperately trying to log into my account at godaddy.com with PHP and Curl and just cannot make it happen. Has anybody written a script for this purpose? Here is what I...
1
by: yawnmoth | last post by:
I was looking at the various cURL options and have a few questions. CURLOPT_HTTPPROXYTUNNEL's being set to true is supposed to tunnel through a given HTTP proxy. Afaik, tunneling is only...
0
by: nfhm2k | last post by:
I've been trying to find a solution to this for quite some time now... I even took a look at existing scripts... Including this one......
4
by: zorro | last post by:
Hello there, I can't figure out why is it that when i use an array for my postfields it doesn't work : this works curl_setopt($curl, CURLOPT_POSTFIELDS, "clown=bozo" ); this doesn't...
0
by: xerc | last post by:
I am trying to create a generic function I can call to download all files from a single remote FTP directory -- using CURL. I want to multi-thread it, but need to get the single thread functionality...
3
by: rottmanj | last post by:
I am re-writing my rets application in perl, and I have found a few modules that will help me on my way. One of them being WWW::Curl:easy. During my testing, I have tested both system curl and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.