DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   PHP (http://www.daniweb.com/forums/forum17.html)
-   -   HTTP request (http://www.daniweb.com/forums/thread159849.html)

Anjali.want4u Nov 28th, 2008 9:27 am
HTTP request
 
Can someone please tell me how to send a HTTP request through PHP .

cwarn23 Nov 29th, 2008 6:48 am
Re: HTTP request
 
Although I don't know anything about it there is a function called http_request(); and the official documentation can be found at http://php.net/manual/kr/function.http-request.php

digital-ether Dec 8th, 2008 6:08 am
Re: HTTP request
 
Quote:

Originally Posted by cwarn23 (Post 746864)
Although I don't know anything about it there is a function called http_request(); and the official documentation can be found at http://php.net/manual/kr/function.http-request.php

Note that this is a pecl extension. You'll have to build it into PHP.

If you need just a simple HTTP Request, you can use file_get_contents().
This makes a HTTP GET Request to the URL you give it (if the http wrapper is enabled allow_url_fopen).

You can also use the curl functions:
http://www.php.net/manual/en/ref.curl.php

Or see the docs on getting remote files:
http://www.php.net/manual/en/features.remote-files.php

For custom HTTP Requests use CURL or you can use fsockopen(), with fread() and fwrite().

Pear also provides a HTTP package:
http://pear.php.net/package/HTTP_Request2


All times are GMT -4. The time now is 3:09 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC