FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
115 stars 19 forks source link

API Call is appending "; charset=utf-8" automatically to Header "Content-Type" #3654

Open johnpreynoso opened 3 weeks ago

johnpreynoso commented 3 weeks ago

Can we access your project?

Current Behavior

In an API Call, FlutterFlow is appending a value to Header "Content-Type".

Even if I explicitly set "Content-Type" to be "application/merge-patch+json", once the API call is made, the header value for "Content-Type" becomes "application/merge-patch+json; charset=utf-8".

001 002 003 004

In the specific case I'm working on, the API call receiver specifically requires the "Content-Type" to be exactly "application/merge-patch+json"; otherwise, the call made will receive status "400: Bad Request".

Expected Behavior

What I was expecting to happen was for FlutterFlow to only send the "Content-Type" value as seen in the Preview below. image

Steps to Reproduce

  1. In FlutterFlow, go to API Calls.
  2. Press "Add" and "Create API Call".
  3. Set API Call Name to: Test API Patch Call
  4. Set Method Type to: PATCH
  5. Set API URL to: https://postman-echo.com/patch
  6. Press "Add Header".
  7. Provide the following value for the new header: Content-Type: application/merge-patch+json
  8. Press on the "Body" tab.
  9. For the body type, select: JSON
  10. In the body content, input the following: { "text": "Test text here." }
  11. Click on "Response & Test".
  12. Under "Preview and Test", select "Headers". The value for "Content-Type" should only be "application/merge-patch+json".
  13. Under "Preview and Test", select "Body" to confirm the contents input in step 10.
  14. Press "Test API Call".
  15. Under "Preview and Test", select "Test Response". Note that the value of "content-type" has now changed to "application/merge-patch+json; charset=utf-8". 005

Reproducible from Blank

Bug Report Code (Required)

Not applicable; this bug is in API Calls.

Visual documentation

Refer to "Steps to Reproduce".

image

image

image

image

Environment

- FlutterFlow version: v4.1.83+
- Platform: Windows
- Browser name and version: FlutterFlow Windows development app
- Operating system and version affected: Windows 11

Additional Information

This is currently a showstopper. The project is integrating FlutterFlow with a Cloud ERP.

In the specific case I'm working on, the API call receiver specifically requires the "Content-Type" to be exactly "application/merge-patch+json"; otherwise, the call made will receive status "400: Bad Request".

Alezanello commented 3 weeks ago

Hello!!

Just to be sure before avdance in testing this issue, have you enabled the "Decode Response as UTF-8"?

image.png
johnpreynoso commented 3 weeks ago

Hello!!Just to be sure before avdance in testing this issue, have you enabled the "Decode Response as UTF-8"?

image.png

Hi, Alezanello.

I do not have that option available since I had to make the call Private. image

github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open for 7 days with no activity. If there are no further updates, a team member will close the issue.

johnpreynoso commented 2 weeks ago

Adding a comment to prevent issue closure (this is still open).

johnpreynoso commented 1 week ago

This program behavior is still happening in v4.1.85+.

github-actions[bot] commented 2 days ago

This issue is stale because it has been open for 7 days with no activity. If there are no further updates, a team member will close the issue.

johnpreynoso commented 2 days ago

Program behavior still happens in v4.1.88+. image