[RUBY] About the mechanism of the Web and HTTP

Browser and server

The browser is the screen that is currently displayed The server is like a big PC that stores various data Displayed in the browser by downloading the file from the server The file contains information such as HTML, CSS, JS, etc.

It looks like this in the figure        (Browser) ←←←←←← (Server) File        (HTML,CSS,JS) HTTP What is HTTP? How to interact with the browser and server Basically request and response

request       →→→→→→ (Browser) (Server)       ←←←←←← response

The request throws the desired information to the server and the server returns that information. It is the server-side language that creates the rules for exchanging this request and response.

4 basic HTTP methods

  1. Get GET data Used when displaying a web page

I want to see this page       →→→→→→ (Browser) (Server)       ←←←←←← Page information

  1. Send POST data Used to save data in forms etc.

Save the data       →→→→→→ (Browser) (Server)       ←←←←←← I saved it

  1. Update PUT data Used when rewriting existing data

Change the data       →→→→→→ (Browser) (Server)       ←←←←←← I changed

  1. DELETE data deletion Used when erasing existing data

Erase the data       →→→→→→ (Browser) (Server)       ←←←←←← I erased it

If you compare it with Twitter View Tweets GET New Tweet Post POST Tweet update PUT (Twitter should not have been possible) Tweet deletion DELETE

IP address and domain

An IP address is like an address assigned to data in a server and is managed numerically. What is a domain? The "~~ .com" part Since it is difficult to understand if it is an IP address, a system called DNS links the IP address and domain.

Until the last website (Qiita) is displayed

Please tell me the IP address of qiita.com       →→→→→→ (Browser) (DNS)       ←←←←←← Returns the IP address

GET request to IP address obtained from DNS       →→→→→→ (Browser) (Server)       ←←←←←← Returns HTML, CSS, JS

It's like this

Recommended Posts

About the mechanism of the Web and HTTP
About the operation of next () and nextLine ()
Learn the rudimentary mechanism and usage of Gradle 4.4
About next () and nextLine () of the Scanner class
Background and mechanism of Fabric-loader
[Grails] About the setting area and the setting items of application.yml
About the description of Docker-compose.yml
About the relationship between HTTP methods, actions and CRUD
About the same and equivalent
[Ruby] Questions and verification about the number of method arguments
[Ruby] About the difference between 2 dots and 3 dots of range object.
[Java] I thought about the merits and uses of "interface"
About the behavior of ruby Hash # ==
Understand the basic mechanism of log4j2.xml
About the basics of Android development
About fastqc of Biocontainers and Java
About the equals () and hashcode () methods
This and that of the JDK
About removeAll and retainAll of ArrayList
Think about the 7 rules of Optional
Summary about the introduction of Device
About the log level of java.util.logging.Logger
What is testing? ・ About the importance of testing
Folding and unfolding the contents of the Recyclerview
About the initial display of Spring Framework
About the error message Invalid redeclaration of'***'
About the treatment of BigDecimal (with reflection)
About the difference between irb and pry
About the number of threads of Completable Future
Check the version of the standard Web software.
About the classification and concept of Immutable / Mutable / Const / Variable of Java and Kotlin.
[Ruby basics] About the role of true and break in the while statement
(Determine in 1 minute) About the proper use of empty ?, blank? And present?
Check the version of the JDK installed and the version of the JDK enabled
About the official start guide of Spring Framework
About the description order of Java system properties
About the idea of anonymous classes in Java
Compare the speed of the for statement and the extended for statement.
[Java] The confusing part of String and StringBuilder
I compared the characteristics of Java and .NET
About the method
About call timing and arguments of addToBackStack method
What are the advantages of DI and Thymeleaf?
About the package
About the mechanism when displaying the GUI with Docker
A memo about the types of Java O/R mappers and how to select them
ArrayList and the role of the interface seen from List
[Ruby] I thought about the difference between each_with_index and each.with_index
[Rails] I learned about the difference between resources and resources
Please note the division (division) of java kotlin Int and Int
[For beginners] DI ~ The basics of DI and DI in Spring ~
About the usefulness of monads from an object-oriented perspective
Talking about the merits of database bind variables ((1) Introduction)
Convert the array of errors.full_messages to characters and output
About the problem of deadlock in parallel processing in gem'sprockets' 4.0
About the difference between classes and instances in Ruby
Organizing the current state of Java and considering the future
Java language from the perspective of Kotlin and C #
Until the use of Spring Data and JPA Part 2
[Java] About Objects.equals () and Review of String comparisons (== and equals)
About Class loading and initialization when the JVM starts