Jira Cloud Rest API field search with name containing special characters


I’m using jira rest api in my atlassian connect plugin.
This endpoint “/rest/api/2/field/search?query=” when i use special characters in the query sometimes it returns 400 bad request and sometimes with the same value it works fine.
FYI : when i use it in postman it always works.

Do you have any ideas ? Thank you