0

I am trying to get the status code for a URL using Apache HTTPGet request. For a URL which belongs to China Marketplace Domain(something like :www.URL.cn) i am getting a return code 503 whereas when i am trying to load the URL in browser i am getting 200 return STatus. Any clues where it might be wrong. Here is the code:

    HttpGet urlGet = new HttpGet(URL); // URL being any valid URL
    HttpResponse urlResponse = (HttpResponse) httpClient.execute(urlGet);
    int returnCode = urlResponse.getStatusLine().getStatusCode();

I have tried setting User Agent as well but with no success. Is there any additional thing required to resolve this.

user3034987
  • 97
  • 10

0 Answers0