15 Rest API Interview Question
15 Rest API Interview Question
com/
REST represents REpresentational State Transfer; it is relatively new aspect of writing web api.
RESTFUL is referred for web services written by applying REST architectural concept are called
RESTful services, it focuses on system resources and how state of resource should be
transported over HTTP protocol to a different clients written in different language. In RESTFUL
web service http methods like GET, POST, PUT and DELETE can be used to perform CRUD
operations.
SOAPUI tool for SOAP WS and Firefox “poster” plugin for RESTFUL services.
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 or new resource
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
1/5
http://career.guru99.com/
5) Mention whether you can use GET request instead of PUT to create a resource?
No, you are not supposed to use POST or GET. GET operations should only have view rights
Resources are identified by logical URLs; it is the key element of a RESTful design. Unlike,
SOAP web services in REST, you view the product data as a resource and this resource should
contain all the required information.
AJAX REST
In Ajax, the request are sent to the REST have a URL structure and a
server by using XMLHttpRequest request/response pattern the
objects. The response is used by revolve around the use of
the JavaScript code to dynamically resources
alter the current page REST is a type of software
Ajax is a set of technology; it is a architecture and a method for users
technique of dynamically updating to request data or information from
parts of UI without having to reload servers
the page REST requires the interaction
Ajax eliminates the interaction between the customer and server
between the customer and server
asynchronously
REST requires the interaction
between the customer and server
REST is stateless, therefore the SERVER has no state (or session data)
With a well applied REST API, the server could be restarted between two calls as every
data is passed to the server
2/5
http://career.guru99.com/
Web service mostly uses POST method to make operations, whereas REST uses GET
to access resources
Shared database
Batch file transfer
Invoking remote procedure (RPC)
Swapping asynchronous messages over a message oriented middle-ware (MOM)
“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 makes one
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
11) Mention which markup language can be used in restful web api?
JSON and XML are the two markup language that can be used in restful web api
12) Mention what is the difference between RPC or document style web services? How
you determine to which one to choose?
In document style web services, we can transport an XML message as part of SOAP request
which is not possible in RPC style web service. Document style web service is most
appropriate in some application where XML message behaves as document and content of that
document can alter and intention of web service does not rely on the content of XML message.
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 communication in JAVA, and JAX-RS
lets you do the REST communication in JAVA.
14) List out the tools or API for developing or testing web api?
3/5
http://career.guru99.com/
SOAP REST
SOAP is a protocol through which Rest is a service architecture and
two computer communicates by design for network-based software
sharing XML document architectures
SOAP permits only XML REST supports many different data
SOAP based reads cannot be formats
cached REST reads can be cached
SOAP is like custom desktop A REST client is more like a
application, closely connected to
browser; it knows how to
the server standardized methods and an
SOAP is slower than REST application has to fit inside it
It runs on HTTP but envelopes the
REST is faster than SOAP
message It uses the HTTP headers to hold
meta information
Guru99 Provides FREE ONLINE TUTORIAL on Various courses like
4/5
http://career.guru99.com/
5/5
Powered by TCPDF (www.tcpdf.org)