title: Unexpected response code 405 com.android.volley.ServerError
body: <p>I want to send form data to server. i m using volly library for that but this following code is showing bellow error.</p>
  
  <blockquote>
    <p>Unexpected response code 405 com.android.volley.ServerError</p>
  </blockquote>
  
  <p><strong>My code is :</strong></p>
  
  <pre><code>public class Wow extends AppCompatActivity {
  
      private EditText editTextName;
      private EditText editTextLocation;
      private EditText editTextEmail;
      private EditText editTextWebsite;
      private Button buttonRegister;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.data_sent_form);
  
          editTextName = (EditText) findViewById(R.id.editTextname);
          editTextLocation = (EditText) findViewById(R.id.editTextlocation);
          editTextEmail = (EditText) findViewById(R.id.editTextEmail);
          editTextWebsite = (EditText) findViewById(R.id.editTextwebsite);
          buttonRegister = (Button) findViewById(R.id.buttonRegister);
  
          buttonRegister.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  suman();
              }
          });
      }
  
      void suman() {
  
          final String name = editTextName.getText().toString().trim();
          final String location = editTextLocation.getText().toString().trim();
          final String email = editTextEmail.getText().toString().trim();
          final String website = editTextWebsite.getText().toString().trim();
  
          try 
          {
              RequestQueue requestQueue = Volley.newRequestQueue(this);
              String URL = "http://myeducationhunt.com/schools/create";
              JSONObject jsonBody = new JSONObject();
              jsonBody.put("name", name);
  
              final String mRequestBody = jsonBody.toString();
  
              StringRequest stringRequest = new StringRequest(Request.Method.POST, URL, new Response.Listener&lt;String&gt;() {
                  @Override
                  public void onResponse(String response) {
                      Log.i("VOLLEY", response);
                  }
              }, new Response.ErrorListener() {
                  @Override
                  public void onErrorResponse(VolleyError error) {
                      Log.e("VOLLEY", error.toString());
                  }
              }) {
  
  
                  @Override
                  public byte[] getBody() throws AuthFailureError {
                      try {
                          return mRequestBody == null ? null : mRequestBody.getBytes("utf-8");
                      } catch (UnsupportedEncodingException uee) {
                          VolleyLog.wtf("Unsupported Encoding while trying to get the bytes of %s using %s", mRequestBody, "utf-8");
                          return null;
                      }
                  }
              };
              requestQueue.add(stringRequest);
          } catch (JSONException e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>**logcat looks like this **</p>
  
  <pre><code>11-15 12:49:13.648 17579-19711/com.user.retrofit E/Volley: [254] BasicNetwork.performRequest: Unexpected response code 405 for http://myeducationhunt.com/schools/create
  11-15 12:49:13.649 17579-17579/com.user.retrofit E/VOLLEY: com.android.volley.ServerError
  </code></pre>