Hi ,
I am getting the below error in Confluence logs while trying to create content in Confluence via it's REST API. I have written a Java client that makes the REST API call to https://<our_confluence_host>/confluence/rest/api/content with json paylaod to craete a page. It uses apache httpclient to make the call.
Below are the http request headers :
request.setHeader("Accept", "application/json");
request.setHeader("Content-Type", "application/json");
HttpResponse response = httpClient.execute(request);
I am getting http status code 500. The Confluence server's application logs prints the below stacktrace. This is an blocker issue for us. Any help is highly appreciated.
I even tried setting "Content-Type" header as "application/json:charset=UTF-8" but taht also did not help.
2018-05-24 10:20:52,760 ERROR [http-nio-8090-exec-8] [rest.api.model.ExceptionConverter] convertServiceException No status code found for exception, converting to internal server error :
-- url: /confluence/rest/api/content | traceId: 8f2a32f5543f5461 | userName: _stagegitportal
org.codehaus.jackson.JsonParseException: Invalid UTF-8 start byte 0xa0
at [Source: com.atlassian.confluence.plugins.restapi.filters.LimitingRequestFilter$1@50455f9c; line: 1, column: 951]
at org.codehaus.jackson.JsonParser._constructError(JsonParser.java:1433)
at org.codehaus.jackson.impl.JsonParserMinimalBase._reportError(JsonParserMinimalBase.java:521)
at org.codehaus.jackson.impl.Utf8StreamParser._reportInvalidInitial(Utf8StreamParser.java:2825)
at org.codehaus.jackson.impl.Utf8StreamParser._reportInvalidChar(Utf8StreamParser.java:2819)
at org.codehaus.jackson.impl.Utf8StreamParser._finishString2(Utf8StreamParser.java:1978)
at org.codehaus.jackson.impl.Utf8StreamParser._finishString(Utf8StreamParser.java:1905)
at org.codehaus.jackson.impl.Utf8StreamParser.getText(Utf8StreamParser.java:276)