Skip to content

feat(http): POST with a JSON body, and paging and cursors in the body - #191

Merged
kvlonge merged 3 commits into
mainfrom
feat/http-post-body
Nov 12, 2026
Merged

kvlonge merged 3 commits into
mainfrom
feat/http-post-body

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

sl.http jobs can now send a POST with a JSON body, and put offset, page-number or cursor values in that body instead of the query string.

  • api.paginate(...) and api.fan_out(...) take method="POST" and json_body. sl.offset, sl.page_number and sl.cursor take location="body", with param (and limit_param) given as paths such as "$.page.cursor".
  • Each page starts from a fresh copy of json_body, and a retry resends the same body. Cursor tokens keep their JSON type.
  • An incremental cursor goes in the body by putting ctx.cursor_value in json_body.
  • A POST follows only 307 and 308 redirects. A 301, 302 or 303, which would resend it as a GET without its body, fails instead. A next link to another origin also fails, so json_body never leaves the connection's origin.
  • These are checked before any request: json_body on a GET, body paging without POST, a bad body path, and a body path that runs through a non-object.
  • GET jobs are unchanged; a test asserts that their requests are byte-identical.

Docs: a new "POST with a JSON body" section in sources/python.mdx, marked as coming in 0.36.0.

Tests: 13 new cases in packages/sqlload/tests/test_http_jobs.py, run against a local stub API. All 59 http job tests pass, and make check is clean.

Closes CHI-1243

…heck body paths up front

A 301, 302 or 303 after a POST now fails instead of being followed as a
GET without its body. A next page on another origin fails rather than
receiving json_body. Connection headers go before the JSON body, so a
connection's Content-Type is the only one sent. A body path that runs
through a non-object in json_body fails before any request. The docs
now mark these features as coming in 0.36.0.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Deploying sqlload with  Cloudflare Pages  Cloudflare Pages

Latest commit: d76db2d
Status: ✅  Deploy successful!
Preview URL: https://dabb863d.sqlload.pages.dev
Branch Preview URL: https://feat-http-post-body.sqlload.pages.dev

View logs

@kvlonge
kvlonge merged commit e6ca559 into main Nov 12, 2026
13 checks 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.

1 participant