cURL Alternative?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jonah Bishop

    #1

    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

  • Toby A Inkster

    #2
    Re: cURL Alternative?

    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!

    Comment

    • Manuel Lemos

      #3
      Re: cURL Alternative?

      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


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

      Comment

      • NC

        #4
        Re: cURL Alternative?

        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:



        Cheers,
        NC

        Comment

        Working...