Skip to content

Conversation

@uzarnom
Copy link

@uzarnom uzarnom commented Nov 1, 2025

The curl command's body now requires the following:

-d '{"body":"this is json data"}' # new
-d '{"data":"this is json data"}' # previous

Which translates to the following in javascript fetch. (This took me 2 days to figure out, I am such an idiot)

fetch('https://64d4d22db370ae41a32e.appwrite.global', {
  method: 'POST',
  headers: {
    'X-Custom-Header': '123',
    'x-appwrite-user-jwt': '<YOUR_JWT_KEY>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    'body': 'this is json data'
  })
});

What does this PR do?

Update the beginner function execution tutorial so the curl command contains the correct data.

Test Plan

I tested it against: https://syd.cloud.appwrite.io/v1 - REST

my javascript code is:

const payload = JSON.stringify({
        'user': l_user,
        'message': l_message
    });
    
    var bodyString = JSON.stringify({
        body: payload
    });

    var request = {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'X-Appwrite-Project': PROJECT_ID,
            'X-Appwrite-JWT': jwt 
        },
        body: bodyString
    }

Related PRs and Issues

I have not looked, but it seems to be well documented somewhere as I found the answer somewhere in solved git issues, and in Discord archived messages.

Have you read the Contributing Guidelines on issues?

I have read the CONTRIBUTING.md, but I am an really stupid (also sick and sleepy).

Summary by CodeRabbit

  • Documentation
    • Updated API request examples to reflect the correct payload structure for function execution in POST requests.

The curl command's body now requires the following:

-d '{"body":"this is json data"}' -- new
-d '{"data":"this is json data"}' -- previous

Which translates to the following in javascript fetch. (This took me 2 days to figure out, I am such an idiot)

fetch('https://64d4d22db370ae41a32e.appwrite.global', {
  method: 'POST',
  headers: {
    'X-Custom-Header': '123',
    'x-appwrite-user-jwt': '<YOUR_JWT_KEY>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    'body': 'this is json data'
  })
});
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 1, 2025

Walkthrough

This pull request updates documentation in the products functions execute page. A curl example was modified to send the function body under the "body" field instead of "data" in the POST payload. Additionally, a trailing newline was added to the Permissions documentation section for file formatting consistency. No exported entities or code logic were altered.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • The curl example field change ("data" to "body") requires verification that the API endpoint correctly accepts the "body" field for function body parameters
  • Documentation-only changes with minimal scope and straightforward nature
  • Consider confirming the API specification aligns with the updated curl example parameter

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "Update beginner function execution tutorial as the expected data has changed" is directly related to the main change in the changeset. The title accurately identifies what is being updated (the beginner function execution tutorial) and the reason for the update (a change in the expected data payload structure). The actual changes involve updating the curl and JavaScript fetch examples to use "body" instead of "data" as the payload key, which aligns precisely with the title's reference to the data format change. The title is concise, specific, and clearly communicates the primary purpose of the changeset without being vague or overly broad.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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