title: Twitter4j: getUserTimeline method sometimes returns http status code 405 when I call user timeline api continuously
body: <p>I am trying to get recent 1000 tweets of 2000 twitter users using Rest API's getUserTimeline() method. It works fine most of the times but some times it stops executing by returning http status code 405. The respose code is as follows</p>
  
  <pre><code>Failed to get timeline: Server returned HTTP response code: 405 for URL:   https://api.twitter.com/1.1/application/rate_limit_status.json?include_entities=1&amp;include_rts=1
  </code></pre>
  
  <p>The full stack trace is:</p>
  
  <pre><code>Server returned HTTP response code: 405 for URL: https://api.twitter.com/1.1/application/rate_limit_status.json?include_entities=1&amp;include_rts=1
      Relevant discussions can be found on the Internet at:
              http://www.google.co.jp/search?q=f68ccb24 or
              http://www.google.co.jp/search?q=6c2d1c77
      TwitterException{exceptionCode=[f68ccb24-6c2d1c77 8612d0f1-19766e3f 8612d0f1-19766e30], statusCode=-1, message=null, code=-1, retryAfter=-1, rateLimitStatus=null, version=3.0.6-SNAPSHOT(build: afd755d42f0c2fd7a2a87cedf1e91e123de2d754)}
              at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:177)
              at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:61)
              at twitter4j.internal.http.HttpClientWrapper.get(HttpClientWrapper.java:89)
              at twitter4j.TwitterImpl.get(TwitterImpl.java:1987)
              at twitter4j.TwitterImpl.getRateLimitStatus(TwitterImpl.java:1901)
              at com.twitter4j.search.GetUserTimeline.main(GetUserTimeline.java:97)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
      Caused by: java.io.IOException: Server returned HTTP response code: 405 for URL: https://api.twitter.com/1.1/application/rate_limit_status.json?include_entities=1&amp;include_rts=1
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
              at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1674)
              at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1672)
              at java.security.AccessController.doPrivileged(Native Method)
              at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1670)
              at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1243)
              at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
              at twitter4j.internal.http.HttpResponseImpl.&lt;init&gt;(HttpResponseImpl.java:50)
              at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:141)
              ... 10 more
      Caused by: java.io.IOException: Server returned HTTP response code: 405 for URL: https://api.twitter.com/1.1/application/rate_limit_status.json?include_entities=1&amp;include_rts=1
              at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1625)
              at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
              at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
              at twitter4j.internal.http.HttpResponseImpl.&lt;init&gt;(HttpResponseImpl.java:35)
              ... 11 more
      Failed to get timeline: Server returned HTTP response code: 405 for URL: https://api.twitter.com/1.1/application/rate_limit_status.json?include_entities=1&amp;include_rts=1
  </code></pre>