Ocs-server/Gfx4/Network utilities

From KDE Community Wiki
Revision as of 16:38, 28 July 2015 by Snizzo (talk | contribs) (Created page with "GFX permits also to interact with other APIs and websites through ENetworkSocket. ENetworkSocket is an object that makes http requests with get and post data to the specified ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

GFX permits also to interact with other APIs and websites through ENetworkSocket. ENetworkSocket is an object that makes http requests with get and post data to the specified address.

$s = new ENetworkSocket("http://localhost"); $c = $s->get("index.php");

This will set content of $c to the content of http://localhost/index.php performing a get request.

$postdata = array( "name" => "john", "surname" => "smith" )

$s = new ENetworkSocket("http://localhost"); $c = $s->post("index.php", $postdata);

This will set content of $c to the content of http://localhost/index.php performing a post request and sending $postdata as $_POST value.