2016-05-02 15 views
1

URLからJSON情報を数分間取得できますが、最終的には「予期しない応答コード429」が表示されます。リンクはSteamのものですが、これがVolleyやSteamの問題なのかどうか疑問に思っていますか?私のコードから何かが紛れている可能性があるので、ここに私の現在の実装があります。AndroidでVolleyを使用しているときに予期しない応答コード429がありますか?

RequestQueue queue = Volley.newRequestQueue(this); 

      // Request a string response from the provided URL. 
      JsonObjectRequest stringRequest = new JsonObjectRequest(Request.Method.GET, retrievalURL, null, 
        new Response.Listener<JSONObject>() { 
         @Override 
         public void onResponse(JSONObject response) { 
          try { 
           int indexOfWear = listOfWears.indexOf(wear); 
           Map<String, String> itemInList = listWearsAndPrices.get(indexOfWear); 
           if (response.getBoolean("success")) { 
            itemInList.put("Price", response.getString("lowest_price")); 
           } else { 
            // If price is not possible 
            itemInList.put("Price", "Item Unavailable"); 
            Log.e("tag", "Item unavailable unreached"); 
           } 
           // Update view 
           adapter.notifyDataSetChanged(); 
          } catch (JSONException e) { 
           e.printStackTrace(); 
          } 
         } 


        }, new Response.ErrorListener() { 
       @Override 
       public void onErrorResponse(VolleyError error) { 
        /** 
        * TODO 
        * CHECK FOR INTERNET CONNECTION 
        */ 
        int indexOfWear = listOfWears.indexOf(wear); 
        Map<String, String> itemInList = listWearsAndPrices.get(indexOfWear); 
        itemInList.put("Price", "Item Unavailable"); 
        adapter.notifyDataSetChanged(); 
       } 
      }); 
      // Add the request to the RequestQueue. 
      queue.add(stringRequest); 
+0

サービスを受ける前にインターネット接続を確認しましたか? –

答えて

1

429応答コードが

Too Many Requests 

The user has sent too many requests in a given amount of time ("rate limiting"). 

は、おそらくあなたは、あなたが一日または一定の時間で行うことができますヒット数に制限されているヒットしようとしているAPIを意味します。

関連する問題