2017-10-10 3 views
-2

// URL
Chaîne CatégorieUrl = "http://lazurd.com/shop/api/rest/custom/categories/";BasicNetwork.performRequest: Code de réponse inattendu 500 dans la volée

StringRequest request = new StringRequest(Request.Method.GET,CategoryUrl,new Response.Listener<String>() { 
     @Override 
     public void onResponse(String response) { 
      Log.d("CODDE",response); 


     } 
    }, new Response.ErrorListener() { 

     @Override 
     public void onErrorResponse(VolleyError volleyError) { 

      Toast.makeText(MainActivity.this,"ERROR",Toast.LENGTH_LONG).show(); 

     } 
    }); 

    RequestQueue queue = Volley.newRequestQueue(this); 
    queue.add(request); 

BasicNetwork.performRequest: code de réponse inattendue pour 500 http://lazurd.com/shop/api/rest/custom/categories/

Répondre

0
final TextView mTextView = (TextView) findViewById(R.id.text); 
... 

// Instantiate the RequestQueue. 
RequestQueue queue = Volley.newRequestQueue(this); 
String url ="http://lazurd.com/shop/api/rest/custom/categories/"; 

// Request a string response from the provided URL. 
StringRequest stringRequest = new StringRequest(Request.Method.GET, url, 
      new Response.Listener<String>() { 
    @Override 
    public void onResponse(String response) { 
     // Display the first 500 characters of the response string. 
     mTextView.setText("Response is: "+ response.substring(0,500)); 
    } 
}, new Response.ErrorListener() { 
    @Override 
    public void onErrorResponse(VolleyError error) { 
     mTextView.setText("That didn't work!"); 
    } 
}); 
// Add the request to the RequestQueue. 
queue.add(stringRequest); 
+0

travail did't même que celui. –