The Anatomy of the Web Flashcards

(21 cards)

1
Q

What is the core of all network

A

the HTTP protocol

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the HTTP protocol?

A

The core of API design and communication over the network is the HTTP protocol
The HTTP protocol is a web standard used to communicate over the internet with services
HTTP is the glue of the internet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the HTTP flow?

A

The HTTP flow is a simple flow that allows clients communicate with servers. The following steps are performed
1) Open a TCP connection: The TCP connection is used to send a request, or several, and receive an answer.

2) Send an HTTP message: HTTP messages (before HTTP/2) are human-readable
3) Read the response sent by the server, such as:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a HTTP request?

A

An HTTP request is when a service is asking another service for information.
Usually from a client to a server.
A request contains a
- A method, the operation that is asked for
- Headers, describe the request and contain info about authentication
- A body, re-request data, only present when we want to update a resource

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are HTTP Methods?

A

HTTP methods are a set of request methods to indicate the desired action to be performed for a given resource. They are also known as HTTP verbs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are HTTP verbs?

A

HTTP verbs are another name for HTTP methods

GET, POST, PUT and DELETE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the most important HTTP methods?

A

GET - Used to retrieve data/get a resource
POST - used to send data / create objects
PUT - Used to update data
PATCH - Used to make partial updates to a resource
DELETE - Used to delete a resource

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are HTTP Headers?

A

HTTP Headers let the client and the server pass additional information with an HTTP request or response.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the important HTTP Headers?

A
  • Accept: tells web service what kind of response the client is accepting
  • Content-type: Tells the client/server what the format of the data is being sent in ex JSON, used in POST and PUT requests
  • Cache-control: Specifies how the response can be cached, used in later requests
  • Authorization: Usually sent by the client, sends a token to be granted access to a resource
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is an HTTP response?

A

An HTTP response is sent by the server to the client, the responses are formed by

  • Status code: indicates what the current status of the response is
  • Headers: Contains information about the content, caching, cookies, etc
  • Body: The actual data of the response, HTML, JSON, plain text, etc
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is an HTTP status code?

A

The status code is a message which contains information about the status of the response.

  • Successful response (200-299)
  • Redirects (300-399)
  • Client Errors (400 - 499)
  • Server Errors (500-599)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the most important status codes?

A

500 - Internal Server Error
200 - OK
301, 302 - Redirected
401 - Not Authorized –> Authorization is missing or falling
403 -> Forbidden
404 –> The content/resource is not found on the server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is CORS?

A

Cors is a system that determines whether the browsers block frontend JS code from accessing responses for requests to another domain, usually fixed by sending the right headers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does REST stand for?

A

REST stands for

Representational State Transfer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is REST?

A

REST is an architectural style for web API’s in order to make them simpler, easier to build, and easier to consume.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the difference between REST and HTTP

A

REST != HTTP
HTTP is how clients and servers communicate
REST is the shape of that communication

HTTP is the pen, paper, and the envelope
REST is the introduction, date, content, and signature

17
Q

What does REST offer?

A
REST offers us all the CRUD operations
Create
Retrieve
Update
Delete
18
Q

What are some of the properties of RESTful API’s?

A

A RESTfull API is:

stateless –> every request can be understood in isolation, by itself, so is not necessary to save anything on the server

cacheable –> clients can reuse data in later requests

uniform -> rest is built around resources and applies many clean code principles: separation of concerns, clear boundaries, etc.

19
Q

What is a REST Resource?

A

The main concept in REST is a resource. Anything can be a resource: an object (e.g. a person, transactions), images, documents, and so on.

20
Q

What is a URI?

A

Each Resource has a unique address called a URI: Uniform Resource Identifier, which is built in the following way:

:////

Example:
http://api.example.com/devices/234

21
Q

What is Base64 ?

A

Base64 is a way to take any form of data and transform it into a long string of plain text so that we can send it through the internet.