I use HTTPUrlConnection to request a REST API.
I ser "Content-type" header as follows :
urlConnection.setRequestProperty("Content-type",
"application/x-www-form-urlencoded");
I set HTTP body as follows :
out = urlConnection.getOutputStream();
out.write(postParameters.getBytes("UTF-8"));
I don't know if I need to escape post parameters(which is a String) when I set HTTP header and body as shown above.
I just need Yes or No as answer, but would be great if the answer explains why yes or why no.