Tuesday, 13 June 2017

13.06.2017.

Tuesday.


The HTTP stands for HyperText Transfer Protocol. HyperText is text with links in it and a transfer protocol is a fancy way of saying "rules for getting something from one place to another." In this case, the rules are for transferring web pages to your browser.


REST (or Representational State Transfer).


  API

application programming interface


For an API or web service to be RESTful, it must do the following:
  1. Separate the client from the server
  2. Not hold state between requests (meaning that all the information necessary to respond to a request is available in each individual request; no data, or state, is held by the server from request to request)
  3. Use HTTP and HTTP methods (as explained in the next section).

HTTP methods

  1. GET: retrieves information from the specified source (you just saw this one!)
  2. POST: sends new information to the specified source.
  3. PUT: updates existing information of the specified source.
  4.  DELETE: removes existing information from the specified source.

Anatomy of a Request

 
An HTTP request is made up of three parts:
  1. The request line, which tells the server what kind of request is being sent (GET, POST, etc.) and what resource it's looking for;
  2. The header, which sends the server additional information (such as which client is making the request)
  3. The body, which can be empty (as in a GET request) or contain data (if you're POSTing or PUTing information, that information is contained here).

 POST /codecademy/learn-http HTTP/1.1

Host: www.codecademy.com

 Content-Type: text/html; charset=UTF-8

 Name=Eric&Age=26





No comments:

Post a Comment

Machine Learning Annotation Introduction

Data annotation in Machine Learning is the process of annotating/ labeling data to categorize the dataset to identify by ML models. It can b...