WSGI request parsing.
最初に以下の最小例でモジュール利用方法を確認し、その後 API リファレンスを参照してください。
from nexom.app.request import Request
# WSGI app 内で
# req = Request(environ)
# body_json = req.json()
# form = req.form()
# files = req.files()
分類: public class
Uploaded file container from multipart/form-data.
このクラスにメソッド定義はありません。
分類: public class
Represents an HTTP request constructed from a WSGI environ. Notes: - headers keys are normalized to lower-case - wsgi.input is readable only once; this class caches parsed body per request - .json() / .form() use cached raw body (bytes) - .files() parses multipart/form-data using python-multipart (external dependency) and cannot be used together with .read_body()/.json()/.form() after reading the stream
分類: special method
__init__(self, environ: WSGIEnviron, *, max_body_size: int | None = None) -> None
メソッドドキュメントは未定義です。
environ / kind=positional-or-keyword / type=WSGIEnviron / 必須 / default=なしmax_body_size / kind=keyword-only / type=int | None / 任意 / default=NoneNone
実装コード内の例外仕様を確認してください。
from nexom.app.request import Request
obj = Request(environ=..., max_body_size=None)
分類: internal method
_parse_cookies(self) -> RequestCookies | dict[str, str] | None
Parse Cookie header into RequestCookies if possible.
RequestCookies | dict[str, str] | None
実装コード内の例外仕様を確認してください。
from nexom.app.request import Request
obj = Request(...)
result = obj._parse_cookies()
print(result)
分類: public method
content_type(self) -> str
Lower-cased mime type without parameters (no charset/boundary). Example: "application/json; charset=utf-8" -> "application/json"
str
実装コード内の例外仕様を確認してください。
from nexom.app.request import Request
obj = Request(...)
result = obj.content_type()
print(result)
分類: internal method
_content_length(self) -> int | None
メソッドドキュメントは未定義です。
int | None
実装コード内の例外仕様を確認してください。
from nexom.app.request import Request
obj = Request(...)
result = obj._content_length()
print(result)
分類: public method
read_body(self) -> bytes
Read and cache request body bytes. WARNING: - If multipart parsing (.files()) already consumed the stream, body will be empty.
bytes
実装コード内の例外仕様を確認してください。
from nexom.app.request import Request
obj = Request(...)
result = obj.read_body()
print(result)
分類: public method
body(self) -> bytes
メソッドドキュメントは未定義です。
bytes
実装コード内の例外仕様を確認してください。
from nexom.app.request import Request
obj = Request(...)
result = obj.body()
print(result)
分類: public method
json(self) -> Any | None
Parse application/json body. Returns: Parsed JSON (dict/list/...) or None if not JSON or empty body. Raises: json.JSONDecodeError: If Content-Type is JSON but body is invalid.
Any | None
from nexom.app.request import Request
obj = Request(...)
result = obj.json()
print(result)
分類: public method
form(self) -> dict[str, list[str]] | None
Parse application/x-www-form-urlencoded body. Returns: dict[str, list[str]] or None if not urlencoded form.
dict[str, list[str]] | None
実装コード内の例外仕様を確認してください。
from nexom.app.request import Request
obj = Request(...)
result = obj.form()
print(result)
分類: public method
files(self) -> dict[str, str | File] | None
Parse multipart/form-data using python-multipart.
dict[str, str | File] | None
実装コード内の例外仕様を確認してください。
from nexom.app.request import Request
obj = Request(...)
result = obj.files()
print(result)
nexom.app.requestservices/venv/lib/python3.10/site-packages/nexom/app/request.py2026-03-14