markdown
HTTP Fundamentalsmd cd65c2e
lecture/information/networks/http-basics.lecture.n.md
Download PDF

HTTP Fundamentals

date2026-07-14document_iddoc_8e935edb23d90a937b6ae5edc6d4c81ddescriptionHTTPの資源指向の要求・応答意味論、メソッド、状態コード、HTTPS、各バージョンの転送方式を説明する。prerequisitesネットワークの基本 / TCPとIPの基本 / DNSの基本type講義statusactiverelateddata/lecture/information/networks/computer-networks-portal.lecture.n.md / data/lecture/information/networks/tcp-and-ip-basics.lecture.n.md / data/lecture/information/networks/dns-basics.lecture.n.md / data/lecture/information/database/database-portal.lecture.n.md
informationnetworksundergraduatelecture
data/lecture/information/networks/dns-basics.lecture.n.md

1Introduction

This lecture explains the semantics of HTTPHypertext Transfer Protocol, through which a client sends a request concerning a resource and a server responds with the result of processing that request. It distinguishes HTTP requests and responses from IP packet forwarding and transport-layer functions.

2Resources and Representations

A resourceResource is a target of HTTP operations and is identified by a URIUniform Resource Identifier. Web pages, images, and data managed by an API can all be treated as resources.

A representationRepresentation is data that represents the state of a resource at a particular time. A single resource can provide representations in HTML, JSON, image formats, or other forms. In this lecture, a URI used to access a resource is called a URLUniform Resource Locator.

In HTTP, a clientClient sends a request, and a serverServer processes that request and returns a response. These roles are defined for each exchange and are not limited to web browsers.

3Request and Response Semantics

Conceptually, an HTTP request contains the following elements:

  • a methodMethod, which specifies the requested semantics for the resource;
  • a request targetRequest target, which identifies the target of the operation;
  • fieldsField, which convey metadata concerning representation formats, authentication, caching, and other matters; and
  • optional contentContent, which conveys a representation to be processed when required.

An HTTP response contains a status codeStatus code that classifies the result of processing the request, fields, and optional content. A status code describes the result for that request, not the state of the server itself.

4An HTTP/1.1 Message Example

HTTP/1.1 represents the start line and fields as text. The following request line is a GET request whose request target is /index.html.

http
GET /index.html HTTP/1.1
Host: example.com
Accept: text/html

The response start line contains the HTTP version, status code, and reason phrase.

http
HTTP/1.1 200 OK
Content-Type: text/html

This textual format is an HTTP/1.1 representation. HTTP/2 and HTTP/3 do not use request lines; they encode HTTP semantics in binary frames.

5Method Properties

GETGET requests transfer of a current selected representation for the target resource. GET is defined as a safeSafe method: the client does not request a change to server state. GET is also idempotentIdempotent: the intended effect on the server of several identical GET requests is the same as the effect of one such request. Incidental effects such as access logging remain permissible.

POSTPOST requests that the target resource process the enclosed representation according to its resource-specific semantics. It can submit a form, create a resource, or initiate a process, so POST cannot be defined merely as file transmission. POST is generally neither safe nor idempotent.

6Status Codes

The first digit of a status code classifies the processing result as follows:

  • 1xx: informational responses;
  • 2xx: successful responses;
  • 3xx: redirection messages;
  • 4xx: client errors; and
  • 5xx: server errors.

200 OK indicates that the request succeeded. 404 Not Found indicates that the server cannot find a current representation for the target resource or is unwilling to disclose that one exists. A 404 response alone therefore does not prove that the resource will never exist.

7HTTPS and TLS

HTTPSHTTPS denotes HTTP communication protected by TLS functions. HTTP/1.1 and HTTP/2 use TLSTransport Layer Security over TCP, while HTTP/3 integrates the TLS handshake and cryptographic functions into QUIC. TLS protects the confidentiality and integrity of communication and normally authenticates the server through certificate validation. HTTPS does not change HTTP request and response semantics. Authentication by TLS also does not guarantee the factual correctness of information supplied by the server.

8HTTP Versions and Transport

VersionPrimary underlying transportHTTP message representation
HTTP/1.1TCPTextual start lines and fields
HTTP/2TCPBinary frames and multiplexing
HTTP/3QUIC over UDPBinary frames and multiplexing over QUIC streams

HTTP semantics such as resources, methods, and status codes are largely common across these versions. Their encodings and underlying transports differ, however. HTTP does not therefore always use TCP.

9Relationship to DNS and Lower Layers

In a typical web access whose URL contains a domain name, a client resolves the name through DNS, connects to a selected IP address, and sends an HTTP request. DNS is not part of HTTP semantics, however, and a client may instead use a cached result or an IP address directly.

IP forwards packets toward their destination. TCP or QUIC provides functions that carry HTTP messages. Above them, HTTP defines the semantics of requests and responses concerning resources.

10Key Points

  • HTTP defines request and response semantics for resources identified by URIs.
  • A method specifies request semantics, while a status code classifies the processing result.
  • HTTPS protects HTTP with TLS. HTTP/1.1 and HTTP/2 normally use TCP, whereas HTTP/3 uses QUIC.

11Next Lecture

data/lecture/information/database/database-portal.lecture.n.md
raw .n.md をコピー
loc をコピー (filepath:line ~ line)
copy share link
copy encoded share link
path をコピー
copy share link
copy encoded share link
copy share link
copy encoded share link
タブを全て閉じる