I solved it myself, it sees as if by default HttpClient version 3.1 assume
that the client has already encoded the URL, so when it constructs a new
URI, the encoding is set to true.  Therefore, I had to make my construction
two part:

PostMethod method = new PostMethod();
method.setURI(new URI(baseUrl + path, false));

It would be nice if the Post, Get, etc. method constructors supported a
parameter to handle this.

On Thu, Feb 5, 2009 at 12:22 PM, Ronald R. DiFrango
<[email protected]>wrote:

> All,
>
> I am trying to process the following URL via the HttpGet method:
>
>
> http://192.168.75.172/search?q=*&requiredfields=(documentLibrary:Yes).(departmentName:HHMI+Institute-wide|departmentName:Finance)&start=0&num=10&access=p&entqr=0&output=xml_no_dtd&client=INSIDE&ud=1&oe=UTF-8&ie=UTF-8&site=default_collection&filter=0&getfields=documentType.security.departmentName.userRole.documentLibrary.mimeType.pageid<http://192.168.75.172/search?q=*&requiredfields=%28documentLibrary:Yes%29.%28departmentName:HHMI+Institute-wide%7CdepartmentName:Finance%29&start=0&num=10&access=p&entqr=0&output=xml_no_dtd&client=INSIDE&ud=1&oe=UTF-8&ie=UTF-8&site=default_collection&filter=0&getfields=documentType.security.departmentName.userRole.documentLibrary.mimeType.pageid>
>
> And I get the following exception:
>
> java.lang.IllegalArgumentException: Invalid uri '
> http://192.168.75.172/search?q=*&requiredfields=(documentLibrary:Yes).(departmentName:HHMI+Institute-wide|departmentName:Finance)&start=0&num=10&access=p&entqr=0&output=xml_no_dtd&client=INSIDE&ud=1&oe=UTF-8&ie=UTF-8&site=default_collection&filter=0&getfields=documentType.security.departmentName.userRole.documentLibrary.mimeType.pageid<http://192.168.75.172/search?q=*&requiredfields=%28documentLibrary:Yes%29.%28departmentName:HHMI+Institute-wide%7CdepartmentName:Finance%29&start=0&num=10&access=p&entqr=0&output=xml_no_dtd&client=INSIDE&ud=1&oe=UTF-8&ie=UTF-8&site=default_collection&filter=0&getfields=documentType.security.departmentName.userRole.documentLibrary.mimeType.pageid>':
> Invalid query
>
> Now when I cut & paste that URL into the browswer it works just fine.  I am
> guess it is some sort of URL Encoding that needs to occur, but I am not sure
> what.
>
> Thanks,
>
> Ron
>



-- 
Ron DiFrango

Reply via email to