Code example for HttpUriRequest

Methods: addHeader

0
        String contentType = request.getContentType();
        if (contentType == null || contentType.toString().length() <= 0) {
            return; 
        } 
        android.util.Log.v("XXX", "setting the content type" + contentType);
        method.addHeader(CONTENT_TYPE, contentType);
    } 
 
    private void checkMultipartParams(Object item, IntentWrapper intent) {
        String fileParamName = intent.getMultipartFileParamName();
        FileBody fileBody = getFileBodyFromFile(intent.getMultipartFile(), fileParamName);
        String uriParamName = intent.getMultipartUriParamName();
        FileBody uriBody = getFileBodyFromUri(intent.getMultipartUri(), uriParamName);
        String extraPram = intent.getMultipartExtraParam();
        StringBody stringBody = getStringBody(extraPram, intent.getMultipartExtraValue());
        String bodyEntity = intent.getBodyEntity();
        if (bodyEntity != null) {
            try { 
                if (item instanceof HttpPost){
                    ((HttpPost)item).setEntity(new StringEntity(bodyEntity, HTTP.UTF_8));
                } else if (item instanceof HttpPut) {