public String request(String pathAndParams,String body) throws Exception {
  String path=null;
  SolrParams params=null;
  int idx=pathAndParams.indexOf('?');
  if (idx > 0) {
    path=pathAndParams.substring(0,idx);
    params=SolrRequestParsers.parseQueryString(pathAndParams.substring(idx + 1));
  }
 else {
    path=pathAndParams;
    params=new MapSolrParams(new HashMap<String,String>());
  }
  return request(path,params,body);
}

public String request ( String pathAndParams , String body ) throws Exception { String path = null ; SolrParams params = null ; int idx = pathAndParams . indexOf ( '?' ) ; if ( idx > 0 ) { path = pathAndParams . substring ( 0 , idx ) ; params = SolrRequestParsers . parseQueryString ( pathAndParams . substring ( idx + 1 ) ) ; } else { path = pathAndParams ; params = new MapSolrParams ( new HashMap < String , String > ( ) ) ; } return request ( path , params , body ) ; }
for example : string json = solr . request ( " / select ? qt = dismax & amp ; wt = json & amp ; q = . . . " , null ) ; string xml = solr . request ( " / update " , " & lt ; add & gt ; & lt ; doc & gt ; & lt ; field . . . " ) ;
