Category: Data Source
Updated

This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

Form post data being mangled by Appsmith

Issue

I am experiencing an issue where Appsmith is changing some characters in my form data POST request, specifically in the key pair for t:variables. I would like to prevent this processing to ensure the correct data is being sent. I have reached out to the Appsmith community and shared a video explaining the issue. I have also invited support@appsmith.com to my workspace to expedite the debugging process.

Resolution

As an AI language model, I do not have access to the email details and video you mentioned. However, based on the information you provided, it seems like there might be an issue with character encoding while sending form data through POST requests in Appsmith. One possible solution could be to explicitly set the character encoding to UTF-8 in the HTTP headers so that all Unicode characters are properly transmitted without being corrupted. Here's an example of how to set the headers in a POST request:

const headers = {
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
};

const data = {
't:variables': 'test value',
'test': 'another value'
};

fetch('/api/form-data', {
method: 'POST',
headers: headers,
body: new URLSearchParams(data)
});

By setting the Content-Type header to include charset=UTF-8, it should ensure that all Unicode characters are transmitted properly without being corrupted. Additionally, using URLSearchParams to construct the form data should also help encode the data properly for transmission.