NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

DJango Rest Framework:

1. Most of the people dont know this exciting technology
2. It is compulsory required technology. Django application with out REST API is like a
human being without hands and legs.
3. It is very very easy technology
4. It is very very small technology.
API
Web API/Web Service
REST
REST API
DJango Rest Framework


API :
Application Programming Interface
The main objective of API is two applications can communicate with each other. API
allows external agent to communicate (integrate and exchange information) with our
application.



In Simple way:
'Methods of communication between software components'

Eg1:
By using API a java application can communicate with python application.
Bookmyshow application can communicate with Payment gateway application to
complete our booking.

Eg2: Authentication with Facebook
Note: Interface of communication between the user and application is nothing but API.

The user can be Human user, an android app or desktop application etc

Web API/Web Service:

The interface of communication between the user and application over the web by using
HTTP is nothing but Web API.

REST: Representational State Transfer:

Representational State Transfer(REST) is an architectural style.
It defines several Rules/Guide Lines to develop Web APIs/Web Services
By using REST, we can develop web APIs 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.
Note: REST is basically an architecture where as RESTFul API is an API that implements
REST.

DJango Rest Framework:

Django REST framework is a powerful and flexible toolkit for building Web APIs.
It is the most commonly used framework in Python World to build WEB APIs.
This framework internally uses all Django facilities like models, views, templates, ORM etc
website: https://www.django-rest-framework.org/
Current Version of DJango Rest Framework: 3.9
It requires:
Python (2.7, 3.4, 3.5, 3.6, 3.7)
Django (1.11, 2.0, 2.1)


===========================================================


By using Web Services, Any application in the world can communicates with any other
application irrespective of language (like Java, Python, .Net etc) and platform (like
windows,Linux,MAC etc).



The applications can communicate by using HTTP Protocol as the common language.
The Message Format is XML or JSON.

API:
Can be used to access functionality of any application.
It may be stand alone application/web application/enterprise application

Web API/Web Service:
Can be used to access functionality of web application by using HTTP

REST: It is an architecture, which provides several guidelines to develop web APIs very
easily and effectively.
==============================================================




RESTful API: The Web API which implements REST principles is called RESTful API.

Django REST Framework:


It provides toolkit to develop RESTful APIs for django based applications very easily.
The main objective of web APIs is interoperability. ie different applications can
communicate with each other irrespective of develop language and platform.

The common communication language is: HTTP

The common message format is: XML/JSON

Note: The most common data representation in web API is Java Script Object Notation
(JSON). It is a collection of key-value pairs just like python dictionaries.
{'eno':100,'ename':'cetpa','esal':1000,'eaddr':'delhi'}


The main advantage of JSON over XML is, it is Machine Friendly and Human Friendly Form.

HTTP Verbs:

HTTP Verbs represent the type of operation what we required.

Based on requirement we have to use the corresponding HTTP verb.

The following are various HTTP Verbs
GET : To get one/more existing resources
POST : To create a new resource
PUT : To update an existing resource like update all fields of employee
PATCH : To perform partial updation of an existing resource like updating only salary
of employee
DELETE : To delete an existing resource.

Note: These are only important HTTP Verbs. The following are not that much important
verbs.

OPTIONS
HEAD
CONNECT
TRACE
LOCK
MOVE
PROFIND
etc

HTTP Verbs vs Database CRUD Operations:
C (CREATE) : POST
R (RETRIEVE/READ) : GET
U (UPDATE) : PUT/PATCH
D (DELETE) : DELETE


Types of Web Services:
There are 2 types of web services

1) SOAP Based WebServices

2) RESTful WebServices

1) SOAP Based Web Services:
SOAP: Simple Object Access Protocol.
SOAP is an XML based protocol for accessing web services.
To describe SOAP based web services we have to use a special language: WSDL
(Web Service Description Language).
SOAP based web services are more secured. We can consume by using RPC Method
calls. These web services can provide support for multiple protocols like HTTP, SMTP,
FTP etc
Limitations:
1) SOAP Based web services will always provide data only in XML format. Parsing of this
XML data is very slow, which creates performance problems.
2) Transfter of XML data over network requires more bandwidth.
3) Implementing SOAP Based Web Services is very difficult.



Note: Because of heavy weight, less performance and more bandwidth requirements,
SOAP based web services are not commonly used these days.

2) RESTful Web Services:

REST stands for Representational State Transfer. It means that each unique URL is a
represention of some object. We can get contents of this object by using HTTP GET, we
can modify by using PUT/PATCH and we can delete by using DELETE.

We can create by using POST.

Most of the times RESTful web service will provide data in the form of JSON, parsing is
not difficult. Hence this type of web services are faster when compared with SOAP
based Web Services.

Transfer of JSON Data over the network requires less bandwidth.

Limitations:

1) It is less secured.
2) It provide support only for the protocols which can provide URI, mostly HTTP.
Note: Because of ligth weight, high performance, less bandwidth requirements, easy
development, human understandable message format, this type of web services are most
commonly used type of web services.

=============================================================










     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.