Introduction and why this matters for the exam
Modern web applications are not single programs. They are many programs — a browser, a mobile app, a server, a payment gateway, a weather service — that must talk to each other and exchange data. The rules and tools that let them talk are called APIs, web services, and asynchronous communication techniques (AJAX).
This chapter fills the "APIs and Architecture" gap. Government IT exams (BCS, Bank IT-officer, various computer-operator and programmer posts) regularly ask: What is an API? What does REST stand for? Which HTTP method is idempotent? What is the difference between SOAP and REST? What does AJAX stand for and which object powers it? Is JSON or XML lighter? After this lesson you will be able to answer every one of these with confidence.
Learning objectives
- Define an API and classify its main types.
- State the six REST principles, the four core HTTP verbs, and common status codes.
- Compare SOAP and REST in a structured table.
- Explain why JSON is a lighter data-exchange format than XML.
- Describe how AJAX works using
XMLHttpRequestand the modernfetchAPI, and read a request-response flow diagram. - Distinguish jQuery
$.ajax,$.get,$.post, and$.load. - Write a small AJAX form / email-validation example.
- Define a web service and outline API authentication (API key, OAuth, JWT).