Core/src/main/java/com/braintreepayments/api/internal/HttpClient.java
public String post(String path, String data) throws Exception {
        HttpURLConnection connection = null;
        try {
            if (path.startsWith("http")) {
                connection = init(path);
            } else {
                connection = init(mBaseUrl + path);
            }

            connection.setRequestProperty("Content-Type", "application/json");
            connection.setRequestMethod(METHOD_POST);
            connection.setDoOutput(true);

            writeOutputStream(connection.getOutputStream(), data);

            return parseResponse(connection);
        } finally {
            if (connection != null) {
                connection.disconnect();
            }
        }
    }
public String post(String path, String data) throws Exception {
        HttpURLConnection connection = null;
        try {
            if (path.startsWith("http")) {
                connection = init(path);
            } else {
                connection = init(mBaseUrl + path);
            }

            connection.setRequestProperty("Content-Type", "application/json");
            connection.setRequestMethod(METHOD_POST);
            connection.setDoOutput(true);

            writeOutputStream(connection.getOutputStream(), data);

            return parseResponse(connection);
        } finally {
            if (connection != null) {
                connection.disconnect();
            }
        }
    }
public String post ( String path , String data ) throws Exception { HttpURLConnection connection = null ; try { if ( path . startsWith ( "http" ) ) { connection = init ( path ) ; } else { connection = init ( mBaseUrl + path ) ; } connection . setRequestProperty ( "Content-Type" , "application/json" ) ; connection . setRequestMethod ( METHOD_POST ) ; connection . setDoOutput ( true ) ; writeOutputStream ( connection . getOutputStream ( ) , data ) ; return parseResponse ( connection ) ; } finally { if ( connection != null ) { connection . disconnect ( ) ; } } }
Performs a synchronous post request.

@param path the path or url to request from the server via HTTP POST
@param data the body of the post request
@return The HTTP body the of the response

@see HttpClient#post(String, String, HttpResponseCallback)
@throws Exception
Performs a synchronous post request .