How to send Request payload to REST API in java?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to retrieve the JSON data from the following: https://git.eclipse.org/r/#/c/11376/ Request URL: https://git.eclipse.org/r/gerrit/rpc/ChangeDetailService Request Method: POST Request Headers: Accept:application/json Content-Type:application/json; charset=UTF-8 Request Payload: {"jsonrpc":"2.0","method":"changeDetail","params":[{"id":11376}],"id":1} I already tried this answer but I am getting 400 BAD REQUEST . Can anyone help me sort this out? Thanks. 回答1: The following code works for me. //escape the double quotes in json string