public static Response callService(String strURL, String RequestBody, String Token, int timeout, Boolean isPostMethod) {
var httpWebRequest = (HttpWebRequest)WebRequest.Create(strURL);
httpWebRequest.GetRequestStream().Write(UTF8Encoding.UTF8.GetBytes(RequestBody), 0, RequestBody.Length);
}
JAVA中以下代码的等价物是什么?
httpWebRequest.GetRequestStream().Write(UTF8Encoding.UTF8.GetBytes(RequestBody), 0, RequestBody.Length);
我在用着:
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
这是 .NET 的 HttpWebRequest 的 JAVA 等价物。