samedi 14 mars 2015

Jsoup returns Status=403 error after migrating the website to Amazon EC2 server

I recently moved my website from HostGator to Amazon EC2 server due to which the android app started having connection issues. To be precise, the app fails to connect to the website URL. Android app uses Jsoup library to connect to URLs of the website. The crash log says:



org.jsoup.HttpStatusException: HTTP error fetching URL. Status=403, URL = "MyWebsiteURL
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:435)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:410)
at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:164)
at org.jsoup.helper.HttpConnection.get(HttpConnection.java:153)


Please note that the website is up and working fine on the web browsers. After doing some investigation, it seems that the new server Amazon EC2 doesn't allow requests from automated processes. JSOUP being a robot kind, therefore fails to get response with error 403.


Have you ever faced this problem in the past? How do I get rid of that?





Aucun commentaire:

Enregistrer un commentaire