API and Web Services Overview - Scholarly Flashcards
API and Web Services Overview - Scholarly Flashcards
Question Answer
What does API stand for? API stands for Application Programming Interface.
What is the function of a Server-side Web API? A Server-side Web API consists of one or more publicly exposed
endpoints to a defined request-response message system,
typically expressed in JSON or XML.
What is the purpose of API testing tools like vREST? vREST provides an online solution for automated testing,
mocking, automatic recording, and specification of RESTful APIs.
What example is given for an API Mashup? GoVoyages.com is cited as an example of a site that utilizes API
Mashups.
What is the significance of Wikipedia in the context of Web 2.0? Wikipedia attracts 1.8 billion unique-device visitors monthly and
has over 57 million articles in more than 300 languages,
exemplifying user-generated content.
What is the communication process in HTTP? Clients and servers communicate by exchanging individual
messages called requests (from the client) and responses (from
the server).
What are the advantages of using APIs? APIs help software communicate and exchange data efficiently,
allow for embedding content more flexibly, and enable
customization of content and services.
What is the role of the HTTP protocol in web applications? HTTP is the foundation of data exchange on the web and
operates as a client-server protocol, where requests are initiated
by the recipient (usually the web browser).
What are the components of an HTTP request structure? 1. A start-line describing the requests to be implemented, or its
status of whether successful or a failure. This start-line is always
a single line.
2. An optional set of HTTP headers specifying the request, or
describing the body included in the message.
3. A blank line indicating all meta-information for the request has
been sent.
4. An optional body containing data associated with the request
like content of an HTML form, or the document associated with a
response.
What are the three elements of the start-line in an HTTP request? 1. An HTTP method, a verb like GET, PUT or POST or a noun
like HEAD or OPTIONS, that describes the action to be
performed.
2. The request target, usually a URL, or the absolute path of the
protocol, port, and domain.
3. The HTTP version, which defines the structure of the
remaining message.
What is the purpose of the HTTP method in a request? The HTTP method describes the action to be performed. For
example, GET indicates that a resource should be fetched, or
POST means that data is pushed to the server.
How is the request target formatted in an HTTP request? The format of the request target varies between different HTTP
methods.
What is the structure of HTTP headers in a request? An HTTP header consists of a case-insensitive string followed by
a colon and a value. The whole header, including the value,
consists of one single line.
What are the different groups of HTTP headers in requests? 1. General headers, which apply to the message as a whole.
2. Request headers, which modify the request by specifying it
further, providing context, or conditionally restricting it.
3. Representation headers, like Content-Type, that describe the
original format of the message data and any encoding applied.
What role does the body play in an HTTP request? The body contains data associated with the request, such as
content of an HTML form or other document data. Not all
requests have a body; requests like GET, HEAD, DELETE, or
OPTIONS usually do not.
Question Answer
What are the two categories of bodies in HTTP requests? 1. Single-resource bodies, consisting of one single file, defined by
the two headers Content-Type and Content-Length.
2. Multiple-resource bodies, consisting of a multipart body, each
containing a different bit of information.
What information does the status line of an HTTP response 1. The protocol version (e.g., HTTP/1.1, HTTP/2.0).
contain? 2. A status code indicating success or failure of the request (e.g.,
200, 404, 302).
3. A status text, a brief textual description of the status code.
What is the structure of HTTP headers in responses? HTTP headers for responses follow the same structure as any
other header: a case-insensitive string followed by a colon and a
value. The whole header, including its value, presents as a single
line.
What are the different groups of HTTP headers in responses? 1. General headers, which apply to the whole message.
2. Response headers, which provide additional information about
the server.
3. Representation headers, which describe the original format of
the message data and any encoding applied.
What are the three categories of bodies in HTTP responses? 1. Single-resource bodies consisting of a single file of known
length.
2. Single-resource bodies consisting of a single file of unknown
length, encoded by chunks.
3. Multiple-resource bodies consisting of a multipart body.
What was the purpose of XML and when was its version 1.0 XML, or Extensible Markup Language, was designed to describe
released? data. Version 1.0 of XML was released in February 1998.
How does XML differ from HTML? XML tags are not predefined unlike HTML. XML DTD and XML
Schema define rules to describe data.
What are the primary components of XML documents? Elements (tags) are the primary components of XML documents.
Elements can contain attributes that provide additional
information.
What is a DTD and what is its purpose in XML? A DTD (Document Type Definition) is a set of rules that specify a
custom set of elements and attributes, serving as grammar to
indicate what tags are legal in XML documents.
What is an advantage of using XML? XML makes documents transportable across systems and
applications, allowing for quick data exchange between different
platforms.
What is a disadvantage of using XML? XML requires a processing application and has a very similar
syntax to other alternatives, which can be confusing. It also has
no intrinsic data type support and the syntax can be redundant.
Who specified JSON and when did it become an ECMA Douglas Crockford specified the JSON format in the early 2000s
standard? and JSON became an ECMA international standard in 2013.
List some differences between JSON and XML. 1. JSON is simple and easy to read/write, while XML is more
powerful.
2. JSON objects have types, while XML data is typeless.
3. JSON is readily accessible as objects; XML needs to be
parsed.
4. JSON does not support comments, XML does.
What are some advantages of using JSON? JSON provides support for all browsers, has a straightforward
syntax, is easy to manipulate, and can transmit structured data
over a network connection.
What is a disadvantage of using JSON? JSON has no namespace support, leading to poor extensibility,
and limited development tools support.