Skip to content

fix: Send POST data as query params instead of request body#5

Open
tuxxon wants to merge 1 commit into
baguskto:mainfrom
tuxxon:fix/post-method-query-params
Open

fix: Send POST data as query params instead of request body#5
tuxxon wants to merge 1 commit into
baguskto:mainfrom
tuxxon:fix/post-method-query-params

Conversation

@tuxxon

@tuxxon tuxxon commented Feb 23, 2026

Copy link
Copy Markdown

Summary

  • Fixes post() method in src/api/client.ts to send data as query parameters instead of JSON request body
  • The Threads Graph API requires POST params as URL query parameters, not request body

Problem

The post() method used axios.post(endpoint, data) which sends data in the request body. The Threads Graph API returns error code 24 ("The requested resource does not exist") because it expects parameters as query strings.

All POST-based tools were affected: publish_thread, create_reply, quote_post, schedule_post, etc.

Changes

- const response = await this.client.post<T>(endpoint, data);
+ const response = await this.client.post<T>(endpoint, null, { params: data });

Test plan

  • publish_thread succeeds (tested on two separate Threads accounts)
  • Verified via direct curl that Threads API expects query params
  • Build succeeds (npm run build)

Fixes #4

🤖 Generated with Claude Code

The Threads Graph API (Meta Graph API) requires POST parameters as
query parameters, not JSON request body. The previous implementation
sent data via `axios.post(endpoint, data)` which puts it in the body,
causing all POST operations to fail with error code 24 ("The requested
resource does not exist").

Changed to `axios.post(endpoint, null, { params: data })` to correctly
send data as URL query parameters.

Fixes baguskto#4

Co-Authored-By: Claude <noreply@anthropic.com>
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.

fix: POST method sends data as request body instead of query params

2 participants