Java HTTP Post sendJsonData(final HttpURLConnection connection, final String data)

Here you can find the source of sendJsonData(final HttpURLConnection connection, final String data)

Description

send Json Data

License

Apache License

Declaration

private static void sendJsonData(final HttpURLConnection connection, final String data) throws IOException 

Method Source Code

//package com.java2s;
//   Licensed under the Apache License, Version 2.0 (the "License");            //

import java.io.IOException;

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

public class Main {
    private static void sendJsonData(final HttpURLConnection connection, final String data) throws IOException {
        new OutputStreamWriter(connection.getOutputStream()).append(data).flush();
    }//from w  w  w  .  ja v  a 2  s .co m
}

Related

  1. put(String url, String content)
  2. put(URL host, String endpoint, String customer, String name, String version, InputStream in)
  3. putPOST(HttpURLConnection h, String query)
  4. requestPost(final String remoteUrl, final byte[] content)
  5. sendJson(URL url, String method, String data)
  6. sendPost(String link, String urlParameters)
  7. sendPost(String url, String data)
  8. sendPost(String url, String urlParameters)
  9. sendPost(String webURL, HashMap postOptions)