Book Image

PHP Ajax Cookbook

Book Image

PHP Ajax Cookbook

Overview of this book

Table of Contents (16 chapters)
PHP Ajax Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Web services


In a typical web-based application, a web client (usually a browser) sends an HTTP request to a web server and the web server sends the response via the HTTP protocol to the client.

For example, let's suppose you want to get the weather report of a particular city. In this scenario, you visit a news portal and search for your city's weather report via HTML in that news portal.

But, web services act in a different manner. Rather than allowing access to the information via HTML pages as we mentioned above, web services cause a server to expose application logic, which the client can use programmatically. In simple words, it means that the server exposes a set of APIs (that is, functions) that a client can call. Thus, a web service is an exposed application on a server, which a client can access using the Internet.

Since the API exposed using web services should be platform independent, XML, as well as JSON, is used for the communication between the client and the server. The set...