I'm running a program that sends requests to the public facebook graph API. Its multithreaded,and user-agent is set ("Mozilla/5.0...").
After 1000-10000 requests it starts getting exception:
"java.io.IOException: Server returned HTTP response code: 403 for URL = https://graph.facebook.com/etc..."
for all threads trying to get a response.
If i stop the process, and restart it, after lets say 10 minutes, it will work, but it will get the exceptions after less requests.
While program is running, and getting these exceptions, I've checked the request via chrome web browser and it got the responses just fine.
I've tried switching user-agent strings on runtime, but it didn't work. Setting a global delay time to all threads when a single thread encounters the exception sometimes works, the timeout isn't consistent.
Since the ip isn't blocked, I'm having a hard time figuring how the API identifies my request and know that I'm not using an actual browser even with user agent property is defined.