Home » Interview Question » Cake Php » Cakephp network socket connection class

Cakephp network socket connection class

Cakephp network socket connection class

CakePHP has own build-in class HttpSocket.It is a network socket connection class which can be used easily for making external webservice requests. It is a great way to communicate with external webservices, or remote apis.You can use HttpSocket to create all types of HTTP requests with the different HTTP method.

Httpsocke get Method : HttpSocket::get($url, $query)

The $query parameter, can either be a query string, or may be an array of keys and values. The get method makes a simple HTTP GET request returning the results.

Basic GET request

Basic POST request : string function post ($uri, $data)

The post method makes a simple HTTP POST request returning the results from the url.Parameter for the post method is same as get method it may be an associative array or my be a query string.

For More Info You Can acces Here

, , , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">