butterfly/src/main/java/com/butterfly/sdk/ButterflyHost.java
/**
     * this function make POST request to given URL and json
     * @param url
     * @param json
     * @return
     */
this function make POST request to given URL and json
@param url
@param json
@return
this function make POST request to given URL and json @param url @param json @return
private boolean post(String url, String json) {
        MediaType JSON = MediaType.get("application/json; charset=utf-8");
        OkHttpClient client = new OkHttpClient();
        RequestBody body = RequestBody.create(json, JSON);
            Request request = new Request.Builder()
                    .url(url)
                    .post(body)
                    .addHeader("BUTTERFLY_HOST_API_KEY", this.key)
                    .build();
            try (Response response = client.newCall(request).execute()) {
                if (response.code() == 200) {
                    return true;
                } else {
                    Log.d("err", "http fail");
                    return false;
                }
            }
            catch (Exception e){
                Log.e("error",e.getMessage());
                return false;
            }
    }
private boolean post ( String url , String json ) { MediaType JSON = MediaType . get ( "application/json; charset=utf-8" ) ; OkHttpClient client = new OkHttpClient ( ) ; RequestBody body = RequestBody . create ( json , JSON ) ; Request request = new Request . Builder ( ) . url ( url ) . post ( body ) . addHeader ( "BUTTERFLY_HOST_API_KEY" , this . key ) . build ( ) ; try ( Response response = client . newCall ( request ) . execute ( ) ) { if ( response . code ( ) == 200 ) { return true ; } else { Log . d ( "err" , "http fail" ) ; return false ; } } catch ( Exception e ) { Log . e ( "error" , e . getMessage ( ) ) ; return false ; } }
this function make POST request to given URL and json
 @param url
 @param json
 @return
this function make POST request to given URL and json @param url @param json @return