Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm a bit confused about API vs WebService. But anyway, which one will you follow to.. lets say to provide simple string or xml or json data return.

Currently i have implemented something 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 as the standard way, how do we even call/name it? Shall i name it API? Or WebService?
  • And in normal way (whenever we need to provide some data out of Server, like above) which one do we implement?
share|improve this question
    
Please provide the difference in terms webservice and api –  zerkms May 15 '13 at 2:10
    
what is the difference between webservice and api? –  夏期劇場 May 15 '13 at 2:10
    
have you read the correspondent wikipedia articles? –  zerkms May 15 '13 at 2:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.