private void setHeaders(XMLHttpRequest xmlHttpRequest) throws RequestException {

        if ((headers != null) && (headers.size() > 0)) {
            for (Map.Entry<String, String> header : headers.entrySet()) {
                try {
                    xmlHttpRequest.setRequestHeader(header.getKey(), header.getValue());
                } catch (JavaScriptException e) {
                    throw new RequestException(e.getMessage());
                }
            }
        } else {
            xmlHttpRequest.setRequestHeader("Content-Type", "text/plain; charset=utf-8");
        }
    }
private void setHeaders ( XMLHttpRequest xmlHttpRequest ) throws RequestException { if ( ( headers != null ) && ( headers . size ( ) > 0 ) ) { for ( Map . Entry < String , String > header : headers . entrySet ( ) ) { try { xmlHttpRequest . setRequestHeader ( header . getKey ( ) , header . getValue ( ) ) ; } catch ( JavaScriptException e ) { throw new RequestException ( e . getMessage ( ) ) ; } } } else { xmlHttpRequest . setRequestHeader ( "Content-Type" , "text/plain; charset=utf-8" ) ; } }
/*
Internal method that actually sets our cached headers on the underlying
JavaScript XmlHttpRequest object. If there are no headers set, then we set
the "Content-Type" to "text/plain; charset=utf-8". This is really lining us
up for integration with RPC.