2

i am trying to access a website using https and get request using apache http client the problem i am facing is that when i try to access my desired url from code it gives the following exception

Caused by: java.net.URISyntaxException: Illegal character in query at index: <some url>

but when i check it, the exception URL is not same as mine, may be it is trying to redirect it

i can more explain my scenario in the following way:

HttpGet get0 = new HttpGet(myurl);
CloseableHttpResponse httpResponse_g0 = httpclient.execute(get0);

then exception comes and states:

Caused by: java.net.URISyntaxException: Illegal character in query at index: <some other url>

can someone explain how this is happening and how can i control it?

Wasif Tanveer
  • 139
  • 3
  • 19

1 Answers1

1

I found an answer to this on the following question: https://stackoverflow.com/a/8065310/698554 actually i have to prevent redirects and capture them manually.

Community
  • 1
  • 1
Wasif Tanveer
  • 139
  • 3
  • 19