 <p>As mentioned in the comments, the problem is your response redirects to another url, your <code>HttpUrlConnection</code> must handle redirects. See <a href="http://www.mkyong.com/java/java-httpurlconnection-follow-redirect-example/" rel="nofollow">this</a> on how to do it. </p>