Unable to use `Array[String]` in `HTTP Request`
Self Checks
- [X] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [X] I have searched for existing issues search for existing issues, including closed ones.
- [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [X] Please do not modify this template :) and fill in all the required fields.
Dify version
Live
Cloud or Self Hosted
Cloud
Steps to reproduce
✔️ Expected Behavior
❌ Actual Behavior
Workflow App: https://udify.app/workflow/UvtkopWluBtN4Ekw
The issue you're encountering with the "Unexpected token" error is likely due to the use of single quotes in your JSON input. JSON requires double quotes for strings.
To resolve this, ensure that your JSON body in the HTTP request is formatted with double quotes, like this:
{
"result": ["1", "2"]
}
Make sure your request body is correctly set up in the HTTP request configuration interface. If you're using a variable, ensure it outputs the JSON in the correct format with double quotes.
To continue talking to Dosu, mention @dosu.
The issue you're encountering with the "Unexpected token" error is likely due to the use of single quotes in your JSON input. JSON requires double quotes for strings.
To resolve this, ensure that your JSON body in the HTTP request is formatted with double quotes, like this:
{ "result": ["1", "2"] }Make sure your request body is correctly set up in the HTTP request configuration interface. If you're using a variable, ensure it outputs the JSON in the correct format with double quotes.
To continue talking to Dosu, mention @dosu.
@docu That's the crux of the problem, but obviously it's not in the user's control
This is a known issue, we plan to support it later.
Hi, @AprilNEA. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.
Issue Summary:
- You reported a bug in the cloud-hosted version of Dify involving
Array[String]in anHTTP Request. - I suggested the issue might be due to incorrect JSON formatting with single quotes.
- You acknowledged this but noted the problem is not user-controllable.
- Crazywoola confirmed it's a known issue and mentioned future support is planned.
Next Steps:
- Please let us know if this issue is still relevant to the latest version of Dify by commenting here.
- If there is no further activity, this issue will be automatically closed in 15 days.
Thank you for your understanding and contribution!
I encounter the same issue in version 0.11.0. Is this issue got fixed in latest version?
I encounter the same issue in version 0.15.3, how can i use jsonarray in post body like [{"name": "jack", "age": 20}, {"name": "alice", "age": 18}]