httpurlconnection

    HttpURLConnection POST 통신

    HttpURLConnection POST 통신

    1. Form values 전달 @Test public void postTemplate() { String response = null; try { String urlPath = "https://webhook.site/{your_unique_url}"; URL url = new URL(urlPath); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.setRequestMethod("POST"); con.setDoOutput(true); String param = "param1=a"; param += "&param2=b"; param += "&param3=c"; param += "&param4=d"; OutputStream os ..