100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Restful API's Django $2.99   Add to cart

Other

Restful API's Django

 0 view  0 purchase
  • Course
  • Institution

Restful API's Django

Preview 4 out of 39  pages

  • August 30, 2023
  • 39
  • 2023/2024
  • Other
  • Unknown
avatar-seller
General Interview Questions
on
RESTful Web Services




1 NARESH IT, 2nd Floor, Durga Bhavani Complex, Satyam Threater Rd, Ameerpet, HYD
Telangana-500016 | Tel:+91 40 2374 6666 | Ph:+91 90009 94007 | www.nareshit.in

,Q1) Explain what is REST and RESTFUL?
☻ REST was first introduced by Roy Fielding in 2000.
☻ REST stands for REpresentational State Transfer. It means that each unique URL is
a represention of some object. it focuses on how state of resource should be
transported over HTTP protocol to different clients written in different languages.

☻ REST is an architectural style.
☻ It defines several Rules/Guide Lines to develop Web APIs/Web Services very easily
in concise way. Hence REST is the most popular Architecture to develop Web
Services.

RESTFul API:
The API which is developed by using REST Architecture is nothing but RESTFul API. i.e
interface between the user and application where API implements REST Architecture. In
RESTFUL web service HTTP methods like GET, POST, PUT, PATCH and DELETE can be used
to perform CRUD operations

Note: REST is basically an architecture where as RESTFul API is an API that implements
REST.

Q2) Explain the architectural style for creating any web API based on REST?
The architectural style for creating web api are
1) We can use HTTP for client server communication
2) We can use XML/JSON to send and receive messages. i.e XML/JSON acts as
formatting language.
3) Each resource/service can be accessed by a unique URL. This URL acts as the
address for the resource/service.
4) Stateless communication

Q3) Explain some Key characterics of REST?
The following are various important key characterics of REST
1) REST is a stateless and hence SERVER has no state(or session data)
2) With a well-applied REST API, the server can be restarted without any impact on
the client
3) Web Services mostly allow
GET  To access resources
POST  To create resources
PUT/PATCH  To update resources
DELETE  To delete resources

Q4) Which protocol is used by RESTful Web services?
RESTful web services use the HTTP protocol as a medium of communication between
the client and the server.



2 NARESH IT, 2nd Floor, Durga Bhavani Complex, Satyam Threater Rd, Ameerpet, HYD
Telangana-500016 | Tel:+91 40 2374 6666 | Ph:+91 90009 94007 | www.nareshit.in

,Q5) What is a "Resource" in REST?
REST architecture treats any content as a resource, which can be either database
record, text files, HTML pages, images, videos or dynamic business information.
Consumer application can send
☻ GET request to access a resource,
☻ POST request to create a resource,
☻ PUT/PATCH request to update a resource,
☻ DELETE request to delete a resource.

Q6) Explain Which markup languages used in the REST API?
 JSON and XML are the most commonly used markup languages in the rest api.
 But these days JSON is commonly used because of light weight, high performance and
less bandwidth requirements.

Q7) What is the most popular way to represent a resource in REST?
XML and JSON are the most popular representations of resources.

Q8) What are various HTTP Methods supported by REST?
The following are various important HTTP Methods supported by REST
1) GET: To access all resources or a particular resource
2) POST: To create a new resource
3) PUT: To update an existing resource
4) PATCH: To perform partial updation of an existing resource
5) DELETE: To delete a particular resource
6) OPTIONS: It represents what are various HTTP Methods supported to access a
resource
7) HEAD: It represents Header part of the GET Response. It provides Meta
information.

Q9) What is idempotent request?
☻ By repeating the request multiple times, If we are getting the same response, such
type of request is called Idempotent request.
☻ PUT is idempotent where as POST is not idempotent.

Q10) Explain the difference between POST and PUT?
☻ In general POST can be used to create a new resource where as PUT can be used
to update an existing resource. PUT is idempotent where as POST is not
idempotent.
☻ POST is not idempotent because it creates a new resource every time.
☻ PUT is idempotent as it won't create any new resource everytime and just
updating existing resource.




3 NARESH IT, 2nd Floor, Durga Bhavani Complex, Satyam Threater Rd, Ameerpet, HYD
Telangana-500016 | Tel:+91 40 2374 6666 | Ph:+91 90009 94007 | www.nareshit.in

, Q11) Explain the difference between PUT and PATCH?
We can use PUT for full updation where as PATCH for partial updation of resources.

Q12) Explain the difference between GET and POST?
https://www.youtube.com/watch?v=E-Y5CeeYJxU

Q13) Explain the format of HTTP Request?
Explain the core components of HTTP Request?

Diagram

HTTP Request contains 3 parts
1) Request Line
2) Request Headers
3) Request Body

1) Request Line:
It contains 3 parts
1) Request Method like GET,POST etc
2) Resource Path (like /api/2/)
3) Protocol version used by browser(HTTP/1.1)

2) Request Headers:
It contains configuration information of the browser(like media types accepted by
browser,encoding types supported by browser) and extra information about request
body

3) Request Body:
It contains original information provided by the client.

Q14) Explain the format of HTTP Response?
Explain the core components of HTTP Response?

Diagram

HTTP Response contains 3 parts
1) Status Line
2) Response Headers
3) Response Body

1) Status Line:
It contains 3 parts
1) HTTP protocol version used by server (HTTP/1.1)
2) Status Code (200)

4 NARESH IT, 2nd Floor, Durga Bhavani Complex, Satyam Threater Rd, Ameerpet, HYD
Telangana-500016 | Tel:+91 40 2374 6666 | Ph:+91 90009 94007 | www.nareshit.in

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller rheaakash1999. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $2.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

76658 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$2.99
  • (0)
  Add to cart