Code example for HttpRequestBase

Methods: setURI

0
                break; 
        } 
    } 
 
    public void setURI(URI uri) {
        mRequest.setURI(uri);
    } 
 
    public void addHeader(String name, String value){
        mRequest.addHeader(name, value);
    } 
 
    public void setContent(String content, String contentType) {
        mRequest.setHeader("Content-Type", contentType);
        //mRequest.setHeader("Content-Length", String.valueOf(content.length())); 
        try { 
            ((HttpPost)mRequest).setEntity(new StringEntity(content, "UTF-8"));
        } catch (UnsupportedEncodingException e) {
            Log.e(CLASS_TAG, "Problem encoding: "+content);
        } 
Stop searching for code, let great code find you!  Add Codota to your java IDE