人気の面接質問と回答・オンラインテスト
面接対策、オンラインテスト、チュートリアル、ライブ練習のための学習プラットフォーム

集中型学習パス、模擬テスト、面接向けコンテンツでスキルを伸ばしましょう。

WithoutBook は、分野別の面接質問、オンライン練習テスト、チュートリアル、比較ガイドをひとつのレスポンシブな学習空間にまとめています。

Chapter 3

Routing, View Functions, URLs, and Flask Request-Response Basics

Learn how Flask maps URLs to Python functions and how web requests become responses.

Inside this chapter

  1. What Routing Means
  2. Route Examples
  3. HTTP Methods
  4. Returning Responses
  5. Real Example

Series navigation

Study the chapters in order for the clearest path from Flask basics to scalable application design, APIs, security, and production operations. Use the navigation at the bottom to move smoothly through the full tutorial series.

Tutorial Home

Chapter 3

What Routing Means

Routing connects incoming URLs to specific Python functions, commonly called view functions. This is one of the core ideas in Flask and in web frameworks generally.

Chapter 3

Route Examples

@app.route("/about")
def about():
    return "About page"

@app.route("/users/<int:user_id>")
def get_user(user_id):
    return f"User {user_id}"

Flask supports dynamic URL segments so routes can respond based on path parameters.

Chapter 3

HTTP Methods

@app.route("/submit", methods=["GET", "POST"])
def submit():
    return "Handled"

Different request methods express different intentions, such as reading, creating, updating, or deleting resources.

Chapter 3

Returning Responses

A Flask view can return plain text, rendered HTML, JSON, redirects, or custom response objects. Understanding those response types is key to building both websites and APIs.

Chapter 3

Real Example

An educational portal may use routes for home, login, course detail, student dashboard, and admin reports. Each route maps a request into the correct business logic and user-facing response.

著作権 © 2026、WithoutBook。