How to put graphql Query into the Unirest request body when you change it to Code snippet using Unirest

Your question may already have an answer on the community forum. Please search for related topics, and then read through the guidelines before creating a new topic.

Hereโ€™s an outline with best practices for making your inquiry.

My question:
How to put graphql Query into the Unirest request body when you change it to Code snippet using Unirest.

  1. How to parse special character?
  2. How to handle escaping characters?

Details (like screenshots):

[ My mutation query ]

mutation {
    create_item (board_id: ${boardId}, group_id: "topics", item_name: "๊ธˆ์•ก ๋ฌธ์˜", column_values: "{\"___9\" : \"business.BOARD.contents(๋ฌธ์˜ ๋‚ด์šฉ)\", \"date4\" : \"business.BOARD.crt_date(๋ฌธ์˜์ผ์‹œ)\", \"___\" : \"business.USER.name(์‚ฌ์šฉ์ž ์ด๋ฆ„)\", \"___8\" : \"business.BOARD.user_id(๋ฌธ์˜์ž ์•„์ด๋””)\", \"____\" : \"business.BOARD.call_no(๋ฌธ์˜์ž ํ•ธ๋“œํฐ๋ฒˆํ˜ธ)\", \"___2\" : \"business.BOARD.email(๋ฌธ์˜์ž ์ด๋ฉ”์ผ)\", \"___5\" : \"business.BOARD.company_name(๋ฌธ์˜์ž ํšŒ์‚ฌ๋ช…)\", \"__\" : \"business.BOARD.Attach_id(๋ฌธ์˜๋‚ด์šฉ ์ฒจ๋ถ€ํŒŒ์ผ)\"}") {
        id
    }
}

[ Code snippet - Java(Unirest) ]

Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://api.monday.com/v2")
  .header("Content-Type", "application/json")
.body("{\"query\":\"mutation {\\n    create_item (board_id: ${boardId}, group_id: \\\"topics\\\", item_name: \\\"๊ธˆ์•ก ๋ฌธ์˜\\\", column_values: \\\"{\\\\\\\"___9\\\\\\\" : \\\\\\\"business.BOARD.contents(๋ฌธ์˜ ๋‚ด์šฉ)\\\\\\\", \\\\\\\"date4\\\\\\\" : \\\\\\\"business.BOARD.crt_date(๋ฌธ์˜์ผ์‹œ)\\\\\\\", \\\\\\\"___\\\\\\\" : \\\\\\\"business.USER.name(์‚ฌ์šฉ์ž ์ด๋ฆ„)\\\\\\\", \\\\\\\"___8\\\\\\\" : \\\\\\\"business.BOARD.user_id(๋ฌธ์˜์ž ์•„์ด๋””)\\\\\\\", \\\\\\\"____\\\\\\\" : \\\\\\\"business.BOARD.call_no(๋ฌธ์˜์ž ํ•ธ๋“œํฐ๋ฒˆํ˜ธ)\\\\\\\", \\\\\\\"___2\\\\\\\" : \\\\\\\"business.BOARD.email(๋ฌธ์˜์ž ์ด๋ฉ”์ผ)\\\\\\\", \\\\\\\"___5\\\\\\\" : \\\\\\\"business.BOARD.company_name(๋ฌธ์˜์ž ํšŒ์‚ฌ๋ช…)\\\\\\\", \\\\\\\"__\\\\\\\" : \\\\\\\"business.BOARD.Attach_id(๋ฌธ์˜๋‚ด์šฉ ์ฒจ๋ถ€ํŒŒ์ผ)\\\\\\\"}\\\") {\\n        id\\n    }\\n}\",\"variables\":{}}")
  .asString();

How I found the problem:
I had a question while using the API of monday.com .