Android 使用JSONArrayRequest实现POST请求有困难

Android 使用JSONArrayRequest实现POST请求有困难,android,post,http-post,android-volley,Android,Post,Http Post,Android Volley,由于某些原因,我试图发布到托管PHP脚本的数据传输不正确。我通过Hurl.it知道我的PHP脚本工作正常,我应该通过POST传递的变量可以在我的类中访问,但是由于某些原因,POST无法工作 我的代码如下: public JSONObject getParams() { Map<String, String> params = new HashMap<>(); params.put("tag", "gamesList"); p

由于某些原因,我试图发布到托管PHP脚本的数据传输不正确。我通过Hurl.it知道我的PHP脚本工作正常,我应该通过POST传递的变量可以在我的类中访问,但是由于某些原因,POST无法工作

我的代码如下:

public JSONObject getParams() {
        Map<String, String> params = new HashMap<>();
        params.put("tag", "gamesList");
        params.put("userID", userID);

        postItems = new JSONObject(params);
        return postItems;
    }

    private void sendJsonRequest() {

        JsonArrayRequest request = new JsonArrayRequest(Request.Method.POST, getRequestURL(10), getParams(), new Response.Listener<JSONArray>() {
            @Override
            public void onResponse(JSONArray response) {
publicJSONObject getParams(){
Map params=新的HashMap();
参数put(“标签”、“游戏列表”);
参数put(“userID”,userID);
positems=新的JSONObject(参数);
返回帖子;
}
私有void sendJsonRequest(){
JsonArrayRequest=newJSONArrayRequest(request.Method.POST,getRequestURL(10),getParams(),new Response.Listener()){
@凌驾
公共void onResponse(JSONArray响应){

我得到一个空数组
[]
作为回应。感谢所有帮助。

进行HTTP捕获将使事情变得清晰。您是否尝试过
JsonObjectRequest
?进行HTTP捕获将使事情变得清晰。您是否尝试过
JsonObjectRequest
?进行HTTP捕获将使事情变得清晰。您是否尝试过
JsonObjectRequest