Getting 403 error trying to access to Pastebin from Java code - java

I was trying to return every lines that a raw pastebin link has.
Everything was going great when suddenly I started receiving this error on console:
java.io.IOException: Server returned HTTP response code: 403 for URL: https://pastebin.com/raw/mBSbY97k
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1993)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1585)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
at java.base/java.net.URL.openStream(URL.java:1162)
at App.execute(App.java:185)
at App.<init>(App.java:164)
at Main.main(Main.java:8)
Link is public and there is no need to log in or authenticate to read it. Probably, the captcha just blocked it but I really don't know when I will be able again to continue with my code.
EDIT: I realized that if I change my IP (I connect to another WIFI) it works. So the question is: what can I do to be able to connect there from my Wifi and, it's needed to force-change my IP?.

Related

Android login and registration with PHP MySQL and SQLite FAIL

I've been following the Androidhive tutorial for login and registration with php mysql and sqlite- https://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/ but there seems to be some issue with connecting to the server.
The logcat shows the error Unexpected response code 403 for http://192.168.x.x/android_login_api/register.php/ and also registration error:null
logcat screen
It shows 404 not found when I search the url - http://192.168.x.x/android_login_api/login.php on my browser. I'm sure this is my correct ip address.The android device connected and the laptop are both on the same wifi. And I've tried several things to solve the network issues by reading similar questions and answers but still no luck.
I've done everything in the tutorial but when I try to register it doesn't work and an empty toast shows and then disappears.
I've checked and rechecked the code but can't seem to get to a solution. Please help.
Go to - C:\wamp64\bin\apache\apache2.4.23\conf\extra\httpd-vhosts.conf
Check if
'require local' is there if yes then change to
'Require all granted'
The 403 Forbidden error is an HTTP status code which means that accessing the page or resource you were trying to reach is absolutely forbidden for some reason.
Also make sure you're accessing the correct url..

Error 503 with my .jar after transfer my website to an other hoster

I created a minecraft launcher with SKCraft and everything was hosted on 000webhost.com. Then I transferred my site to hostinger.com and changed all the links to point to my new host.
Except that since, I get this error:
java.io.IOException: Did not get expected response code, got 503 for https://ragnaguys.hostingerapp.com/latest.json
at com.skcraft.launcher.bootstrap.HttpRequest.expectResponseCode(HttpRequest.java:154)
at com.skcraft.launcher.bootstrap.Downloader.execute(Downloader.java:74)
at com.skcraft.launcher.bootstrap.Downloader.run(Downloader.java:42)
at java.lang.Thread.run(Unknown Source)
Only the URL of the file has changed in my code and the link is functional from a browser.
Is there anything I need to change in the server configuration? Since on the program side nothing changed except the link.
Everything works fine if I put the links back to 000wewhost.com
Thanks!

This page isn’t working localhost is currently unable to handle this request. HTTP ERROR 500 servlet

I searched on google but it is giving the answers on PHP. This error occurred in servlet. I checked the code, it's correct. To confirm the code is correct I debug the code and there is nothing wrong.
Still Getting This error.

Rest Assured - Getting Operation Timed Out Error while testing using RestAssured. But The same endpoint working fine in browser

I have an endpoint to be tested using RestAssured. The same endpoint is working fine while opening it in browser/Postman. But, while trying to test the same using RestAssured,
I am getting Operation Timed Out Error.
I had to connect to proxy to make that end point working in browser. used the same proxy in the rest assured also.
Sample Code below:
given().proxy("My_Proxy_URL_HERE",8080).when().get("My_API_URL_Here").then().log().all();
I am getting the response as
"Operation Timed Out" with Status Code 503.
I need your suggestion, what could be the possible issue, how to debug etc. Any suggestion is appreciated. Thanks in advance.
There can be many reasons for this behavior:
The address is just wrong and given there is some load balancer/proxy it can be configured to wait for a certain period of time and then respond with 503 status code.
Note, 503 is not a "request timed out", but "Service Unavailable".
The request url is good, but the request lacks some headers so that the load balancer/proxy won't be able to route the request to the required server.
How to check this? there exist tools that can come handy in this situation:
Check the access logs of the load balancer/proxy and even of your server if its possible - and see the request.
If it doesn't help, try to compare requests coming from rest-assured vs regular request. You can use tools like Burp for example, there are others, or you can even roll your own.
The idea is simple:
Start the "interceptor" on some port of your local computer (say, 9999 for example)
Configure the interceptor to forward all the requests to proxy of your choice (identified by URL - My_Proxy_URL_HERE and port 8080).
Now rest-assured must call localhost:9999 and the request will be intercepted by this tool. You'll be able to inspect its contents - headers, body, http method - everything.
Do the same for browser request and compare.

error while calling a soap webservice in eclipse

java.io.IOException: Server returned HTTP response code: 500 for URL: https://***/fiwebservice/services/FIUsbWebService
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1459)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
at com.abcde.testClient.TestClientTry.main(TestClientTry.java:109)
I have replaced the url as *** for security purpose, as it is confidential..
Why is there an error when I call a soap webservice in eclipse?
Please help me regarding this.
It seems that there is an error in com.abcde.testClient.TestClientTry. Could you provide the logs and the the source of the File?
Http 500 can mean many things. In Spring security I think that can mean that you didnt have the appropriate authentication to reach the resource. Without knowing much about your server side its hard to say what the problem is or how to solve it.
What kind of technology did you have at the server?
HTTP status code 500 usually means that the web server code crashes.
If HttpURLConnection#getResponseCode() and error and HttpURLConnectionof#getErrorStream() instead of (to the status code to determine in advance), it is necessary to read. It can in other words, information about the problem.
Host if blocked you, you have got the code 4NN State, as the more 401 and 403rd

Categories

Resources