Set method in Java HTTPURLConnection - Java
Set method
Snippet Code
Use the above line of code to set Method
URL urlClass=new URL("url string");
HttpURLConnection ucon=(HttpURLConnection)urlClass.openConnection();
ucon.setRequestMethod("GET");
For post method
URL urlClass=new URL("url string");
HttpURLConnection ucon=(HttpURLConnection)urlClass.openConnection();
ucon.setRequestMethod("POST");
Tags