rest api attachment's comment is messy code when input chinese word

Nelson Chou
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 15, 2023

sample code as below.

Unirest.config().verifySsl(false);
HttpResponse<JsonNode> response = Unirest
.post(CF_RESTAPI_URL + "/content/" + contentId + "/child/attachment/" + fileId + "/data")
.basicAuth(CF_RESTAPI_ACCOUNT, CF_RESTAPI_PASSWORD)
.header("X-Atlassian-Token", "no-check")
.field("file", new File(filePath))
.field("minorEdit", "true")
.field("comment", "Example attachment comment測試123", "text/plain; charset=UTF-8")
.asJson();

 

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.16.3
TAGS
AUG Leaders

Atlassian Community Events