0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

クエリパラメータの利用例

Posted at

クエリパラメータとは

  • URLの末尾の「?」のあとに指定するキーと値の組わせのことです。
  • WebページやAPIの動作をカスタマイズするために使われます。
  • 「&」を指定することで、複数のパラメータを指定できます。

クエリパラメータの利用例

検索
 http://localhost:8000/search?name=キーワード
言語
 http://localhost:8000/search?lang=ja
ソート、ページネーション
 http://localhost:8000/search?sort=desc

FastAPIのクエリパラメータ

main.py
from fastapi import FastAPI


app = FastAPI()


@app.get('/items/')
async def find_by_name(name: str):
    return {'name': name}

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?