The Atom Format
In this lesson, we'll look at the Atom format.
We'll cover the following
Introduction #
Atom is a data format originally developed to make blogs accessible to readers. An Atom document contains blog posts that subscribers can read in chronological order. Besides blogs, Atom can also be used for podcasts.
Because the protocol is so flexible, it is also suitable for other types of data.
- For example, a microservice can offer information about new orders to other microservices as an Atom feed. This corresponds to the REST approach, which uses established web protocols such as HTTP for the integration of applications.
Atom is not a protocol, but a data format.
A GET request to a new URL such as http://innoq.com/order/feed can return a document with orders in the Atom format. This document can contain links to the details of the orders.
MIME Type #
HTTP-based communication indicates the type of content with the help of MIME types (Multipurpose Internet Mail Extensions).
The MIME type for Atom is
application/atom+xml
.
Thanks to content negotiation, other data representation can be offered in addition to Atom for the same URL.
Content negotiation is built into HTTP. The HTTP client signals via an accept header what data formats it can process. The server then sends a response in a suitable format. Thus, accept headers enable a client to request all orders as JSON or the last changes as an Atom feed under the same URL.
Feed #
Get hands-on with 1400+ tech skills courses.