我正在尝试通过邮寄发送值,但我不知道该怎么做。 这是我的密码
public class ConnectionPost {
public void getResponse(Context context, final String url, OnSuccessful successful, OnFailed failed) {
final OnSuccessful onSuccessful = successful;
final OnFailed onFailed = failed;
RequestQueue queue = Volley.newRequestQueue(context);
StringRequest stringRequest = new StringRequest(Request.Method.POST, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
onSuccessful.Successful(response);
Log.i("___check_res2", response);
Log.i("___check_res3", url);
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
onFailed.Failed(error.getMessage());
}
});
queue.add(stringRequest);
}
}