Skip to content

POST requests#5

Merged
rartino merged 2 commits intomainfrom
develop
Mar 26, 2026
Merged

POST requests#5
rartino merged 2 commits intomainfrom
develop

Conversation

@rartino
Copy link
Copy Markdown
Member

@rartino rartino commented Mar 26, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 26, 2026 23:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the ASGI runtime to accept POST requests and makes POST body parameters available to the site rendering pipeline (function injection + template context), enabling server-rendered pages to react to form/JSON submissions.

Changes:

  • Add an HttpRequestContext model to carry method/query/postvars/headers through rendering.
  • Update ASGI runtime to accept POST and extract POST variables from urlencoded, JSON, and multipart requests.
  • Update function injection to validate/execute against merged input parameters (query + postvars) and adjust warning text; add a POST form test.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/test_publish_warnings.py Updates expected warning substring to match new wording.
tests/test_functions.py Adds coverage for function injection using POST form parameters.
src/httk/web/runtime/asgi.py Enables POST requests and implements POST body extraction into request context.
src/httk/web/model/request.py Introduces HttpRequestContext dataclass for request-scoped data.
src/httk/web/model/init.py Exports HttpRequestContext from the model package.
src/httk/web/functions/python_module.py Renames function handler argument from query to params to reflect merged inputs.
src/httk/web/engine/site_engine.py Accepts request context, adds postvars/request to template context, and merges params for function injection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/httk/web/runtime/asgi.py
Comment thread src/httk/web/runtime/asgi.py
Comment thread src/httk/web/runtime/asgi.py
@rartino rartino merged commit 89ffbbf into main Mar 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants