Skip to Content
Pythonクイックリファレンス 第4版
book

Pythonクイックリファレンス 第4版

by Alex Martelli, Anna Martelli Ravenscroft, Steve Holden, Paul McGuire, 鈴木 駿, 株式会社クイープ
June 2024
Intermediate to advanced
864 pages
12h 14m
Japanese
O'Reilly Japan, Inc.
Content preview from Pythonクイックリファレンス 第4版

20章HTTPの処理

Webブラウザ(またはその他のWebクライアント)がサーバーにページをリクエストすると、サーバーから静的なコンテンツが返される場合と動的なコンテンツが返される場合がある。動的コンテンツを提供するには、多くの場合はデータベースに格納されている情報に基づいて、サーバー側のWebプログラムがコンテンツをその場で生成して配信する必要がある。

Webの初期の歴史では、サーバー側プログラミングの標準はCGI(Common Gateway Interface)であり、クライアントが動的コンテンツをリクエストするたびにサーバーが別のプログラムを実行する必要があった。プロセスの起動にかかる時間、インタープリタの初期化、データベースへの接続、スクリプトの初期化が合わさると、無視できないほどのオーバーヘッドになる。CGIはあまりスケーラブルではなかった。

最近のWebサーバーは、オーバーヘッドを削減するためにサーバーに特化したさまざまな方法をサポートしており、ヒットごとに新しいプロセスを開始するのではなく、複数のヒットに対処できるプロセスから動的コンテンツを提供する。このため本書では、CGIは取り上げない。既存のCGIプログラムをメンテナンスするか、いっそのこと、より現代的なアプローチに移行させる方法については、オンラインドキュメントを読み(特に勧告についてはPEP 594†1を参照)、標準ライブラリモジュールcgi†2およびhttp.cookies†3を調べてみよう†4。

マイクロサービス†5ベースのシステムが登場したこともあり、HTTPは分散システムの設計においてこれまで以上に根本的なものとなっており、頻繁に使われるJSONコンテンツをプロセス間で転送するための便利な手段となっている。インターネット上では、何千ものHTTPデータAPIが一般に公開されている。 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

並行プログラミング入門 ―Rust、C、アセンブリによる実装からのアプローチ

並行プログラミング入門 ―Rust、C、アセンブリによる実装からのアプローチ

高野 祐輝

Publisher Resources

ISBN: 9784814400812Publisher Website