23 String url =
"https://backmobile1.onrender.com/appCART/ver_dashboard/";
24 RequestQueue queue = Volley.newRequestQueue(context);
25 JsonObjectRequest request =
new JsonObjectRequest(Request.Method.GET, url,
null,
28 if (response.has(
"results")) {
29 JSONArray pedidos = response.getJSONArray(
"results");
30 callback.onSuccess(pedidos);
32 callback.onError(
"No hay resultados en la respuesta");
34 } catch (Exception e) {
35 callback.
onError(
"Error parseando respuesta: " + e.getMessage());
39 String msg =
"Error al obtener pedidos";
40 if (error.networkResponse !=
null) {
41 msg +=
". Código: " + error.networkResponse.statusCode;
43 callback.onError(msg);
47 public Map<String, String> getHeaders() {
48 Map<String, String> headers =
new HashMap<>();
50 headers.put(
"Authorization",
"Bearer " + token);