title: Got error Unexpected response code 404 for my url while volley post request my code is
body: <pre><code>StringRequest stringRequest = new StringRequest(Request.Method.POST, url , new Response.Listener&lt;String&gt;() {
      @Override
      public void onResponse(String response) {
              Log.d("response", response.toString());
      }
  }, new Response.ErrorListener() {
      @Override
      public void onErrorResponse(VolleyError error) {
          error.printStackTrace();
          Log.d("error", String.valueOf(error));
      }
  })
  {
      @Override
      public Map&lt;String, String&gt; getParams() {
          Map&lt;String, String&gt; params = new HashMap&lt;&gt;();
          params.put("name", paramName);
          params.put("email", paramEmail);
          return params;
      }
  };
  
  RequestQueue requestQueue = Volley.newRequestQueue(this);
  requestQueue.add(stringRequest);
  </code></pre>
  
  <p>}</p>
  
  <blockquote>
    <p>This is my code and i dont anderstand why this happned<strong>Got error Unexpected response code 404 for my url while volley post request my code is</strong></p>
  </blockquote>
  
  <p>and below is my back end code</p>
  
  <pre><code>public function postRequest(Request $request) {
      $response = array();
      $name = $request-&gt;input('name');
      $email = $request-&gt;input('email');
  
      $saveData = new Users();
      $saveData-&gt;name = $name;
      $saveData-&gt;email = $email;
  
      $saveData-&gt;save();
  
      if(isset($saveData)) {
          $response['code'] = 200;
          $response['status'] = 'success';
          $response['content'] = "Data saved Successfully";
      } else {
          $response['code'] = 400;
          $response['status'] = 'error';
          $response['content'] = "Error in data saving";
      }
  
      return response($response, $response['code'])
                  -&gt;header('content_type', 'application/json');
  </code></pre>
  
  <p>Got error Unexpected response code 404 for my url while volley post request my code is
      }<strong>strong text</strong></p>