Skip to content

feat: add POST method and body support to multi_format_api_handler#55

Merged
gabrielbressan-tfy merged 2 commits into
mainfrom
modify-multi-format-api-handler-to-accept-post
Apr 27, 2026
Merged

feat: add POST method and body support to multi_format_api_handler#55
gabrielbressan-tfy merged 2 commits into
mainfrom
modify-multi-format-api-handler-to-accept-post

Conversation

@gabrielbressan-tfy
Copy link
Copy Markdown
Collaborator

Summary

  • Adds method connection arg (STR, GET or POST, default GET) — fully backward-compatible
  • Adds body connection arg (DICT) for the default JSON request body sent with POST requests
  • Both args are also settable per-query via the WHERE clause (consistent with existing headers pattern)
  • POST requests skip the HEAD pre-check (many POST endpoints reject HEAD) and call requests.post(json=body)
  • Body is shallow-merged: connection-level body provides defaults, query-level keys override them

Usage

-- POST at query level
SELECT * FROM handler.data
WHERE url = 'https://api.example.com/search'
  AND method = 'POST'
  AND body = '{"query": "test", "limit": 10}';

-- POST at connection level
CREATE DATABASE my_api WITH ENGINE = 'multi_format_api', PARAMETERS = {
  "url": "https://api.example.com/search",
  "method": "POST",
  "body": {"api_key": "abc", "query": "default"}
};
SELECT * FROM my_api.data;

gabrielbressan-tfy and others added 2 commits April 24, 2026 14:27
Adds `method` (GET/POST) and `body` (JSON dict) connection args to the
multi_format_api handler. POST requests skip the HEAD pre-check and send
the body as JSON. Body is shallow-merged from connection and query levels,
with query-level keys taking precedence.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@gabrielbressan-tfy gabrielbressan-tfy merged commit 84e632e into main Apr 27, 2026
0 of 2 checks passed
@gabrielbressan-tfy gabrielbressan-tfy deleted the modify-multi-format-api-handler-to-accept-post branch April 27, 2026 14:46
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