-
Bug
-
Resolution: Answered
-
Low
-
None
-
5.9.7, 1000.100.0
-
1
-
Severity 3 - Minor
-
NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.
Summary
REST API GET title parameter doesn't work with UTF-8 characters
Steps to Reproduce
- Create a page with the "Обзор" title
- Run the following cURL
curl -u admin:admin -X GET "http://localhost:8090/confluence/rest/api/content?title=Обзор&spaceKey=<space-key>"
Expected Results
The GET command returns all the page's information.
Actual Results
The code doesn't work and returns:
{"results":[],"start":0,"limit":25,"size":0,"_links":{"self":"http://localhost:8090/confluence/rest/api/content?spaceKey=GP&title=%C3%90%C2%9E%C3%90%C2%B1%C3%90%C2%B7%C3%90%C2%BE%C3%91%C2%80","base":"http://localhost:8090/confluence","context":"/confluence"}}
Notes
POST cURL works for the "Обзор" word:
curl -u admin:admin -X POST -H 'Content-Type: application/json' -d'{"type":"page","title":"1. Обзор","space":{"key":"GP"},"body":{"storage":{"value":"<p>This is a new page</p>","representation":"storage"}}}' http://localhost:8090/confluence/rest/api/content/
Workaround
Use the pageid= instead of the title=
curl -u admin:admin -X GET "http://localhost:8090/confluence/rest/api/content?pageid=10813474&spaceKey=GP"
- relates to
-
CONFCLOUD-42670 REST API GET title parameter not working with UTF-8 characters
-
- Closed
-
I don't think this is a bug, running the following curl command results in a legit server exception
curl -u admin:admin -X GET "http://localhost:8080/confluence/rest/api/content?spaceKey=HAS&title=æøå"
which is a hint that there is an issue with the way we make the request, as a matter of fact "æøå" and other similar characters need to be encoded in the URL.
The correct way to achieve this through a curl command is as follow
You have to use the --data-urlencode option, and -G to append it as a query parameter (otherwise it is treated as a POST request body)
Below some curl docs :