0% found this document useful (0 votes)
140 views15 pages

Terms in This Set (52) : Study Sets, Textbooks, Questions

RESTful web services use HTTP methods like GET, POST, PUT, and DELETE to perform CRUD operations on resources identified by URIs. Key characteristics of REST include using stateless communication and representing resources as objects that can be acted upon. JSON and XML can both be used to represent resources, and frameworks like JAX-RS help bind these to Java objects to build RESTful web APIs. Common tools for developing and testing REST APIs include Jersey, Spring MVC, and CXF.

Uploaded by

ganam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
140 views15 pages

Terms in This Set (52) : Study Sets, Textbooks, Questions

RESTful web services use HTTP methods like GET, POST, PUT, and DELETE to perform CRUD operations on resources identified by URIs. Key characteristics of REST include using stateless communication and representing resources as objects that can be acted upon. JSON and XML can both be used to represent resources, and frameworks like JAX-RS help bind these to Java objects to build RESTful web APIs. Common tools for developing and testing REST APIs include Jersey, Spring MVC, and CXF.

Uploaded by

ganam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

REST Flashcards | Quizlet https://quizlet.

com/257760051/rest-flash-cards/

Study sets, textbooks, questions Free trial

REST
Terms in this set (52)

REpresentational State Transfer

What are REST and RESTful


In RESTFUL web service http methods like GET,
Web Services?
POST, PUT and DELETE can be used to perform
CRUD operations.

The architectural style for creating web api are


•HTTP for client server communication
Explain the architectural style
•XML/JSON as formatting language
for creating web api?
•Simple URI as the address for the services
•Stateless communication

1 of 15 26-Feb-22, 3:08 PM
REST Flashcards | Quizlet https://quizlet.com/257760051/rest-flash-cards/

HTTP methods supported by REST are:


•GET: It requests a resource at the request URL. It
should not contain a request body as it will be
discarded. May be it can be cached locally or on
the server.
•POST: It submits information to the service for
processing; it should typically return the modified
What are the HTTP methods
or new resource
supported by REST?
•PUT: At the request URL it update the resource
•DELETE: At the request URL it removes the
resource
•OPTIONS: It indicates which techniques are
supported
•HEAD: About the request URL it returns meta
information

Resources are identified by logical URLs; it is the


key element of a RESTful design.
What are resources in a REST
Unlike, SOAP web services in REST, you view the
architecture?
product data as a resource and this resource
should contain all the required information.

Some key characteristics of REST include:


•REST is stateless, so there is no storage of session
data on the client.
Mention some key
•With a well applied REST API, the server could be
characteristics of REST
restarted between two calls as every data is
passed to the server
•REST uses GET to access resources

JAXB stands for Java API for Xml Binding.


Explain how JAXB is related to This framework is used to bind XML or JSON to
RESTful web api? Java objects without the need for creating XML or
JSON parsers.

2 of 15 26-Feb-22, 3:08 PM
REST Flashcards | Quizlet https://quizlet.com/257760051/rest-flash-cards/

PUT: puts a file or resource at a particular URI and


exactly at that URI. If there is already a file or
resource at that URI, PUT changes that file or
resource. If there is no resource or file there, PUT
What is the difference makes one
between PUT and POST?
POST: sends data to a particular URI and expects
the resource at that URI to deal with the request.
The web server at this point can decide what to do
with the data in the context of specified resource.

Which markup language can JSON and XML are the two markup languages that
be used in restful web api? can be used in Restful web api

Both JAX-WS and JAX-RS are libraries (APIs) for


doing communication in various ways in Java.
JAX-WS is a library that can be used to do SOAP
What is JAX-WS and JAX-RS?
communication in JAVA.
JAX-RS lets you do the REST communication in
JAVA.

Testing tools for web services for REST APIs


include:
•Spring REST web service using MVC
List out the tools or API for
•Jersey API
developing or testing web API
•CXF
•Axis
•Restlet

3 of 15 26-Feb-22, 3:08 PM
REST Flashcards | Quizlet https://quizlet.com/257760051/rest-flash-cards/

Though both RESTful web series and SOAP web


service can operate cross platform they are
architecturally different to each other, here is
some of differences between REST and SOAP:
REST is more simple and easy to use than SOAP
What are some differences
REST uses HTTP protocol for producing or
between RESTful web
consuming web services while SOAP uses XML.
services and SOAP web
REST is lightweight as compared to SOAP and
services ?
preferred choice in mobile devices and PDA's.
REST supports different format like text, JSON and
XML while SOAP only support XML.
REST web services call can be cached to improve
performance.

RESTful web services make use of HTTP protocol


Which protocol is used by
as a medium of communication between client
RESTful webservices?
and server.

A client sends a message in the form of a HTTP


Request and the server responds in the form of a
What is messaging in RESTful HTTP Response.
webservices? This technique is termed as Messaging.
These messages contain message data and
metadata i.e. information about message itself.

4 of 15 26-Feb-22, 3:08 PM
REST Flashcards | Quizlet https://quizlet.com/257760051/rest-flash-cards/

Verb: Indicate HTTP methods such as GET, POST,


DELETE, PUT.
URI: Uniform Resource Identifier (URI) to identify
What are the core the resource
components of a HTTP HTTP Version: Indicate HTTP version.
Request? Request Header: Contains metadata for the HTTP
Request message
Request Body: Message content or Resource
representation.

Status/Response Code: Indicate Server status for


the requested resource.
What are the core HTTP Version: Indicate HTTP version.
components of a HTTP Response Header: Contains metadata for the
response? HTTP Response
Response Body: Response message content or
Resource representation.

URI stands for Uniform Resource Identifier.


Each resource in REST architecture is identified by
its URI.
The purpose of an URI is to locate a resource on
What is a URI?
the server hosting the web service.
URI format example:
<protocol>://<service-name>/<ResourceType>
/<ResourceID>

5 of 15 26-Feb-22, 3:08 PM
REST Flashcards | Quizlet https://quizlet.com/257760051/rest-flash-cards/

As per REST architecture, a RESTful web service


should not keep a client state on server. This
restriction is called statelessness. It is
What is statelessness in responsibility of the client to pass its context to
RESTful Webservices? server and then server can store this context to
process client's further request. For example,
session maintained by server is identified by
session identifier passed by the client.

HTTP Status code are standard codes and refers


What is the purpose of HTTP to predefined status of task done at server.
Status Codes? Example, HTTP Status 404 states that requested
resource is not present on server.

What does the HTTP Status It means, OK.


Code 200 state? It shows success.

It means, CREATED.
What does the HTTP Status When a resource is successfully created using
Code 201 mean? POST or PUT request, it returns a link to the newly
created resource using the location header.

It means, no CONTENT.
What does the HTTP Status Example:
Code 204 mean? a DELETE request happens and the response
body is empty, a 204 code will return.

It means, BAD REQUEST


What does the HTTP Status It states that invalid input is provided.
Code 400 mean? Example:
validation error, missing data.

6 of 15 26-Feb-22, 3:08 PM
REST Flashcards | Quizlet https://quizlet.com/257760051/rest-flash-cards/

It means, FORBIDDEN.
It states that a user does not have access to a
What does the HTTP Status
method being used.
Code 403 mean?
Example:
delete access without admin rights.

What does the HTTP Status It means, NOT FOUND.


Code 404 mean? It states that the method is not available.

It means, INTERNAL SERVER ERROR.


What does the HTTP Status
It states that server has thrown some exception
Code 500 mean?
while executing the method.

7 of 15 26-Feb-22, 3:08 PM
REST Flashcards | Quizlet https://quizlet.com/257760051/rest-flash-cards/

"As RESTful web services work with HTTP URLs


Paths so it is very important to safeguard a RESTful
web service in the same manner as a website is be
secured. Following are the best practices to be
followed while designing a RESTful web service −
Validation − Validate all inputs on the server.
Protect your server against SQL or NoSQL
injection attacks.
Session based authentication − Use session based
authentication to authenticate a user whenever a
What are the best practices to request is made to a Web Service method.
be followed while designing a No sensitive data in URL − Never use username,
secure RESTful web service? password or session token in URL , these values
should be passed to Web Service via POST
method.
Restriction on Method execution − Allow
restricted use of methods like GET, POST, DELETE.
GET method should not be able to delete data.
Validate Malformed XML/JSON − Check for well
formed input passed to a web service method.
Throw generic Error Messages − A web service
method should use HTTP error messages like 403
to show access forbidden etc."

A RESTful web service is based on


representational state transfer technology, an
what is REST architectural style and approach to
communications often used in web services
development.

8 of 15 26-Feb-22, 3:08 PM
REST Flashcards | Quizlet https://quizlet.com/257760051/rest-flash-cards/

Representational State Transfer


A concept around architectural constraints,
specifically on server, client relationships
Principles of REST:
1 - Separation of client server concerns
Explain REST
2 - statelessness
3 - cache-able
4 - Layered
5 - Code on Demand (optional)
6 - Uniform interface

Code on Demand Sending executable code across the net

REST APIs have a lot of similarities


Uniform interface ex: /api/users/3. anyone who uses rest will
understand this endpoint

9 of 15 26-Feb-22, 3:08 PM
REST Flashcards | Quizlet https://quizlet.com/257760051/rest-flash-cards/

A pyramid graph of different levels of RESTfulness


Level 0: a server that hands out information.
delivers json, html, http, etc
Level 1: Resources. organzie endpoints to deliver
resources.
ex: an endpoint that delivers a method to call a
delete function.
ex: (Resource + metadata = Representation)
transferring representation from endpoint
Level 2: Http Verbs
Richardson Maturity Model
thinking of server as handling specific requests
with specific http verbs
proper organization of endpoints with http verbs
use verbs the way they were meant to be
Level 3: Hypermedia Control
HATEOAS (Hypertext As The Engine Of
Application State)
The point of hypermedia controls is that they tell
us what we can do next, and the URI of the
resource we need to manipulate to do it.

prepared for net traffic


produce: content - jsp, html.
produce and consume server
consume: calling endpoint.
client. can be another application

platform independent
lightweight approach
What is an advantage of REST good performance
Simple http is used to make calls between
machines.

10 of 15 26-Feb-22, 3:08 PM
REST Flashcards | Quizlet https://quizlet.com/257760051/rest-flash-cards/

The principle behind the client-server constraints


is the separation of concerns. Separating the user
Separation of concerns interface concerns from the data storage
concerns improves the portability of the user
interface across multiple platforms.

server is unaware of client state


client is unaware of server state
statelessness
ex: the client shouldn't / doesn't need to know is
server goes down for a second

Information sent is safe to cache


ex: we make a get request to server. the likely
hood that information from database will change
Cache-able
should be nill.
ex: stock market info is not safe to cache b/c if you
are looking at cache info you will be behind

Assumption
Assume you don't directly talk with server
this means that at each stop of the way is another
Layered place you can have info cached
rest services seem fast b/c it relies on caching.
info is cached on your machine and on every
router stop along the way to the server

Representational State Transfer.


An architecture, not a design pattern.
REST is a method of allowing communication
what is REST
between a web based client and server that
employs representational state transfer constraints
to create desirable properties.

11 of 15 26-Feb-22, 3:08 PM
REST Flashcards | Quizlet https://quizlet.com/257760051/rest-flash-cards/

Separation between client and server.


what are the advantages of Visibility, reliability and scalability.
REST the rest api is always independent of the type of
platform or language.

Statelessness: is when the server does not store


any state about the client session on the server.
what is REST Statelessness ?Each request from the client contains all the info
to understand the request.
Session state is kept on the client side.

Richardson Maturity Model


Level 0: Make Http calls
Level 1: URI - Specific endpoints for each resource
what is required to be a fully
Level 2: Http proper use of verbs
RESTful web service
Level 3: HATEOAS Hyper media As The Engine Of
Application state. The site provides hypermedia
links with each response

Clients should be able to make the call multiple


times and produce the same result.
GET and PUT are idempotent.
Define Idempotence? It can be made multiple times and get the same
result.
POST is not idempotent. Repeated POST calls to
users will create multiple users.

what are the disadvantages of Latency in request processing times.


using REST Bandwidth usage.

How do you handle You should send HTTP error codes.


exceptions in REST @ExceptionHandler

12 of 15 26-Feb-22, 3:08 PM
REST Flashcards | Quizlet https://quizlet.com/257760051/rest-flash-cards/

1xx infomational response


2xx: Success
3xx: redirection
4xx client errors
5xx server errors
100 Continue
200 OK
300 choices: resource has options client can
choose from
400 Bad Request: server refuses to process
request
explain the status codes and 500 Internal Server Error: when unexpected
how they are used condition occurs

102: Processing: server has received and is


processing the request, but no response is
available
202: request has been ready to processes but it
hasnt completed
302: Found: bad practice
402 Payment required: reserved for future use
502 Bad Gateway: server was acting as a gateway
and received an invalid response from upstream
server

What Protocols does REST only html


support

What security features ...


does REST have

13 of 15 26-Feb-22, 3:08 PM
REST Flashcards | Quizlet https://quizlet.com/257760051/rest-flash-cards/

soap is web service communication protocol.


rest is a architectural style
soap has been around longer
soap exposes components of application logic as
services rather than data
rest operates through a solitary interface to access
named resources
rest created a way to access web services easier
using http

benefits of rest
rest allows more data formats. soap only allows
What are some differences xml
between SOAP and REST rest is easier to work with
rest offers superior performance through caching
info
rest is used by yahoo, ebay, amazon, google
rest is generaly faster and uses less bandwidth

benefits of soap
soap offers robust security- soap supports ws-
security
soap offers built in retry logic to compensate for
failed communications. rest doesn't have a built in
messaging system.
there are no standard set of rules for rest

What Media types ...


does REST support

since rest only uses HTTP, it is stateless.


Are REST & SOAP Stateless since soap can use other transport protocols, it
can contain state

14 of 15 26-Feb-22, 3:08 PM
REST Flashcards | Quizlet https://quizlet.com/257760051/rest-flash-cards/

How do you expose ...


and consume REST

Use SOAP for any situations requiring xml


message encryption, reliable messaging in
In what situations would you environments with erratic connectivity, or atomic
propose using SOAP or transactions because these functions are built-in.
REST? Use REST whenever you need simple data
manipulation of a resource such as that provided
by the http verbs GET, PUT, POST, and DELETE

15 of 15 26-Feb-22, 3:08 PM

You might also like