API

     

  • API stands for Application Programming Interface
  •  

  • API is the way to extract the data from web sites officially, many platforms allows the user to scrap the data using links
  •  

     

  • Through API we send request to the web site and retrieve data in form of JSON or XML
  •  

  • JSON denotes -- JavaScript Object Notification
  •  

    Liabraries used:

  • urllib
  • requests
  •  

    Status Codes:

  • 200 -- Request successful and result attained
  • 301 -- Server is redirecting to some other web
  • 401 -- Request is in accurate, wrong request
  •  

     

    HTTP Methods

     

  • HTTP stands for Hypertext Transfer Protocol
  • User makes request through HTTP protocol
  •  

    HTTP Request Methdos:

  • GET
  • POST
  • PUT
  • DELETE
  •  

     

    What is Rest API

     

     

  • As part of REST API, user interacts with application\Database through URL
  • It returns the result based on request provided by the user
  •  

    GET Request

     

     

  • Ex: driver.get(https://www.google.com/)
  •  

    POST Request

     

  • POST method is used when user submit information through form filling
  • User sends the data to server
  • Server stores the information in database or at defined destination
  •  

     

    GET Vs POST Methods:

     

    PUT Request

     

  • PUT request enables the user to update the existing data\object
  •  

     

    DELETE Request

     

  • Enabels to delete data