Android Volley: POST request - req.body inside of NodeJS REST API empty
<p>I know its been discussed like a billion times, and I have read a couple of questions/answers and this one in particular seemed like a good example -> <a href="https://stackoverflow.com/questions/24414652/volley-jsonobjectrequest-post-request-ignoring-params">example</a>. So now I have tried to recreate the code and added my <code>getParams()</code> as well as my <code>getHeaders()</code>.
Awkwardly I get a HTTP Status Code 400: </p>

<p><code>E/Volley: [303] BasicNetwork.performRequest: Unexpected response code 400 for http://10.0.2.2:3000/classes</code></p>

<p>Since I have created the REST API I can see where this status code 400 comes from, its my NodeJS response if the <code>req.body</code> doesn't contain <code>mAtt, mDatum, mRID, mVon</code>. So now I know that my <code>POST</code> request is not properly working even tho I set my <code>getParams()</code>as well as my <code>getHeaders()</code> ... </p>

<p>Now, my guess would be that I'm setting Params but I'm fetching <code>req.body.mAtt, req.body.mDatum , req.body.mRID, req.body.mVon</code>, that would explain why my NodeJS returns the status code 400. If I fetched <code>req.query.mAtt</code> I would probably get something back? </p>

<p>Is there a certain method that need to be overridden by me, to actually set the body instead of the query params?</p>

<p>This is what my POST req looks like: </p>

<pre><code>    JsonObjectRequest JOPR = new JsonObjectRequest(Request.Method.POST,
                       myAcitveLessonPOSTUrl, null, new Response.Listener&lt;JSONObject&gt;(){
        @Override
        public void onResponse(JSONObject response) {
            try {
                VolleyLog.v("Response:%n %s", response.toString(4));
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
    }, new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            VolleyLog.e("Error: ", error.getMessage());
        }
    }){
        @Override
        public Map&lt;String, String&gt; getHeaders() throws AuthFailureError {
            HashMap&lt;String, String&gt; headers = new HashMap&lt;String, String&gt;();
            headers.put("Content-Type", "application/json");
            return headers;
        }

        @Override
        protected Map&lt;String, String&gt; getParams()
        {
            Map&lt;String, String&gt;  params = new HashMap&lt;String, String&gt;();
            params.put("mAtt", "+1");
            params.put("mDatum", mDatum);
            params.put("mRID", mRID);
            params.put("mVon", mVon);

            return params;
        }


    };


    requestQ.add(JOPR);
</code></pre>

<p>Thank you!</p>