Send PUT, DELETE HTTP request in HttpURLConnection
问题 I have created web service call using java below code. Now I need to make delete and put operations to be perform. URL url = new URL("http://example.com/questions"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(true); conn.setRequestMethod( "POST" ); conn.setRequestProperty("Content-Type", "application/json"); OutputStream os = conn.getOutputStream(); os.write(jsonBody.getBytes()); os.flush(); When I add below code to perform DELETE action it gives