私はAndroidアプリケーションでvolleyを使用してHTTP GETリクエストを行っています。次のエラーが発生する -AndroidでVolleyを使用してHTTP GETリクエストを送信中にエラーが発生しました。
(HTTPLog)-Static: isSBSettingEnabled false
(HTTPLog)-Static: isSBSettingEnabled false
BasicNetwork.performRequest: Unexpected response code 500 for D/LOG ENTRY(21952): com.android.volley.ServerError
同じHTTP要求を行うためにRESTクライアントを使用すると、正常に実行されます。
マイバレーボール要求コードがある -
RequestQueue queue2 = Volley.newRequestQueue(appContext);
JsonObjectRequest req = new JsonObjectRequest(Request.Method.GET,url,null,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Log.d("Response",response.toString());
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.d("LOG ENTRY",error.toString());
}
}) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap<String, String> headers = new HashMap<String, String>();
headers.put("clientSecret", appContext.getString(R.string.username));
return headers;
}
};
// Add the request to the RequestQueue.
queue2.add(req);
あなたはエラーが
:
は、この行を追加しますか?エラー500は内部サーバーエラーです(エラーはサーバー側にあります)。 –
私もそうだと思っていましたが、REST APIクライアントで同じリンクを使用すると、問題の内容がわからない場合があります。 – AP01
似たようなHTTPリクエストを10回送信しています。毎回ランダムにこのエラーが発生します。 。 getCause()またはgetStackTrace()の空の場合 – AP01