Code example for HttpURLConnection

Methods: setRequestMethodsetDoInputsetDoOutputsetRequestPropertysetUseCaches

0
	sUsr = sUser;
	sPwd = sPassword;
 
	URL oUrl = new URL(sUrl);
    oCon = (HttpURLConnection) oUrl.openConnection();
    oCon.setRequestProperty("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
    oCon.setDoOutput(true);
    oCon.setDoInput (true);
    oCon.setUseCaches(false);
	oCon.setRequestMethod("POST");
  } // connect 
 
  /** 
   * Send SMS 
   * @param SMSMessage 
   * @return SMSResponse 
   * @throws IOException 
   * @throws SQLException 
   * @throws IllegalArgumentException 
   * @throws UnsupportedEncodingException 
Experience pair programming with AI  Get Codota for Java