0% found this document useful (0 votes)
28 views

Module 3 - Data Formats

This document provides an overview of common data formats used in APIs, including JSON and XML. It explains that JSON and XML are often used to represent data exchanged between servers and clients. JSON uses a simple keys and values structure built on JavaScript, while XML uses a nested tag structure like HTML. The document also notes that the HTTP Content-Type header specifies the data format, and the Accept header indicates what format the client can understand.

Uploaded by

Walter Peralta
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Module 3 - Data Formats

This document provides an overview of common data formats used in APIs, including JSON and XML. It explains that JSON and XML are often used to represent data exchanged between servers and clients. JSON uses a simple keys and values structure built on JavaScript, while XML uses a nested tag structure like HTML. The document also notes that the HTTP Content-Type header specifies the data format, and the Accept header indicates what format the client can understand.

Uploaded by

Walter Peralta
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Module 3: Data Formats

Rey Benjamin M. Baquirin, MSCS


Data Formats
• Explore the data that APIs provide
• How it is formatted
• How HTTP makes it possible
Representing Data
• APIs work by knowing the proper input and output data formats to
and from the Server

• The most common formats found in modern APIs are: JSON


(JavaScript Object Notation) and XML (Extensible Markup Language)
Built on
Javascript, a
PL ubiquitous
to front-end
and back-end
web
applications

Values: actual
01
details of the
attribute that
04 Very simple
describes the
object
02 structure: keys
and values
03
Keys:
represent an
attribute about
the object
being
described

JSON (JavaScript Object Notation)


Old Data
Format (1996)
but still used
today

Instead of
01
keys, XML
nests nodes
04 Much like
02 HTML, uses
tags
03
Tags are start
and end,
containing
details in
between

XML (Extensible Markup Language)


XML always starts with the root node with an arbitrary
number of child nodes inside
JSON and XML with HTTP
• All data formats are
determined in the
HTTP Headers through
the Content-type
header.

• This header lets the


server/client know
how the request body
is formatted
JSON and XML with HTTP
• The content type is important
as the client/server first checks
if it can understand the specific
format otherwise it responds
with an error
• In some cases, clients are only
limited to one specific format
• As such, the Accept header
comes into play. This header
tells the server what data
format the client can read
Canvas
Quiz
Exams Next
Next Week Meeting

Canvas
Final Project: Module 3 -
API Submission
Walkthrough

You might also like