Code example for HttpEntity

Methods: writeTo

0
    } 
 
    static ByteArrayOutputStream extractBody(HttpEntity entity) throws IOException {
 
        ByteArrayOutputStream ostream = new ByteArrayOutputStream();
        entity.writeTo(ostream);
        // Logger.v(LOG_TAG, ostream.toString()); 
        return ostream;
    } 
 
    static void insertXML(String body, HttpEntityEnclosingRequestBase method) {
 
        insert(body, "text/xml", "text/xml", method);
    } 
 
    static void insertUrlEncodedAcceptingJson(String pEncodedBody,
            HttpEntityEnclosingRequestBase method) {
 
        insert(pEncodedBody, "application/x-www-form-urlencoded", "application/json", method);
    }