Learning / Web Basics / Chapter 4
Web Standards
REST, SOAP, JSON, XML and why timing matters
How systems talk to each other: REST vs. SOAP, JSON vs. XML, synchronous vs. asynchronous communication, and which fits which use case.
Beginner · 11 slides · 11 min
APIs: contracts between systems
An API defines which questions a system accepts and which answers it gives, like a menu in a restaurant.
REST: resources and HTTP verbs
In REST everything is a resource with its own URL, and HTTP verbs like GET, POST, PUT and DELETE say what to do with it.
SOAP: the formal envelope
SOAP wraps every call in an XML envelope with header and body, described precisely by a WSDL contract.
REST vs. SOAP
Style, data format, contract, weight and typical use: how REST and SOAP differ.
JSON
JSON is the compact, readable data format of modern web APIs: objects, arrays, text, numbers, true/false and null.
XML
XML describes data with tags and attributes, and adds comments, namespaces and strict schemas.
JSON vs. XML
The same data in both formats: size, data types, validation, and when to use which.
Synchronous vs. asynchronous
Synchronous means waiting for the answer. Asynchronous means sending the request and carrying on. The result comes later.
Which one when?
REST + JSON as the default, SOAP + XML when the other side requires it. Synchronous when you need the answer now, asynchronous when the work takes time.
Check yourself
How should an API handle a report that takes three minutes to generate?
Recap
REST, SOAP, JSON, XML, synchronous and asynchronous: web standards in five sentences.