Java HTTP Post writeContent(HttpURLConnection urlConn, String content)

Here you can find the source of writeContent(HttpURLConnection urlConn, String content)

Description

write Content

License

Apache License

Declaration

static void writeContent(HttpURLConnection urlConn, String content) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;

public class Main {
    static void writeContent(HttpURLConnection urlConn, String content) throws IOException {
        OutputStreamWriter out = new OutputStreamWriter(urlConn.getOutputStream());
        out.write(content);/*from w w  w.j  a v  a2s. c o m*/
        out.close();
    }
}

Related

  1. sendPostRequest(Reader data, URL endpoint, Writer output)
  2. sendPostRequest(Reader data, URL endpoint, Writer output)
  3. sendPostRequest(String requestURL, Map params)
  4. URLPost(String strUrl, Map map)
  5. writeBody(HttpURLConnection connection, String body)
  6. writeFileFromUrl(URL sourceUrl, File targetFile)
  7. writeString(HttpURLConnection conn, String content, String charsetName)
  8. writeToConnection(final HttpURLConnection couchdbConnection, final String content)