如何将java.net.http.HttpRequest主体读取为字节数组(byte [])?

 收藏

We are using Java 11 and use java.net.http.HttpClient APIs for calling REST APIs. We have the requirement of signing the request message with API Key before sending to the server. Would like to know how to read the java.net.http.HttpRequest body as a byte array (byte[]) for use with the library that is used for signing the request.

回复