web services - PHP: To implement API or WebService to transfer simple data? -
i'm bit confused api vs webservice
. anyway, 1 follow to.. lets provide simple string or xml or json data return.
currently have implemented like:
server:
echo json_encode("hello, ".$_post["q"]);
client:
$ch = curl_init(); curl_setopt($ch, curlopt_url, $server_url); curl_setopt($ch, curlopt_post, 1); curl_setopt($ch, curlopt_postfields, array('q' => 'world!')); curl_setopt($ch, curlopt_header, 0); curl_setopt($ch, curlopt_returntransfer , 1); $response = curl_exec($ch); curl_close($ch);
- normally standard way, how call/name it? shall name
api
? orwebservice
? - and in normal way (whenever need provide data out of server, above) 1 implement?
Comments
Post a Comment