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);
}
What is the equivalent of the following code in JAVA?
httpWebRequest.GetRequestStream().Write(UTF8Encoding.UTF8.GetBytes(RequestBody), 0, RequestBody.Length);
I'm using:
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
which is the JAVA equivalent to .NET's HttpWebRequest.