HTTP POST without cURL

Need to do a HTTP POST, but your PHP for whatever reason does not have access to Curl? Wez Furlong wrote a simple function that does HTTP POST via stream_context_create, which should work out to be faster than Curl-based HTTP POST, since stream functions do not have the overhead.

Posted in PHP, Programming at November 15th, 2006. Trackback URI: trackback

One Response to “HTTP POST without cURL”

  1. December 18th, 2006 at 4:42 am #Armands Pučs

    Hello!

    This function is super-useful :)

    But I can`t seem to understand how the $data var must be

    I tried to call the function like this: do_post_request(”http://www.a.com/test.php”, “cocobongo”);

    test.php is opened (I can see it in the log) but $_POST[content] is empty.

    I am probaby not understanding something basic about php, but could someone please post a working example on how the function must be called.

    Thanks in advance for help :)

    Armand from Latvia

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>