• elstensoftware over 10 years ago

    Hi, just a quick tip if anyone else is running into this. I use the Apache HTTP client to access the Discogs API and I was getting this message:

    2011-03-07 17:46:31,616 (thread main) WARN Failed to query with url http://www.discogs.com/search?type=releases&q=title%3A%22essential+chill+out%22+AND+artist%3A%22Various%22&f=xml&api_key=[censored] will try next query (DiscogsLookupStrategy.java:392)
    org.apache.commons.httpclient.ProtocolException: The server www.discogs.com failed to respond with a valid HTTP response
    at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1987)
    at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
    at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
    at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
    at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)

    I bashed my head against the wall until I noticed this bit of the wiki page:

    "Please use an identifiable User-Agent header on all requests. This helps our logging and reduces the risk of you getting banned."

    Sure enough, I added my header and now it works again. Not sure when that was added. Is there a way to keep track of these changes?

    Hope this helps someone.
  • Sikke303 over 10 years ago

    Works 100% ! Great topic :)

Log In You must be logged in to post.