title: PUT/DELETE giving 405 error with angular and WebAPI in VS Community 2015
body: <p>I am getting 405(Method not found) error in PUT and DELETE requests in my angular and WebAPI. GET and POST are working fine. I have checked all the solutions with this type of error on 'SO' but it didn't worked. I have added required handlers(with PUT/DELETE verbs) in my <em>WebConfig</em>, updated <em>applicationhost.config</em> of IIS EXpress and also uninstalled <em>WebDAV</em> module but still the problem persists.</p>
  
  <p>Here is my controller code: </p>
  
  <pre><code>[RoutePrefix("api/BlogPost")]
  public class BlogPostController : ApiController
  {
      // GET: api/BlogPost
      public IQueryable&lt;BlogPostModel&gt; GetblogPostTb()
      {
          return db.blogPostTb;
      }
  
      // GET: api/BlogPost/5
      [ResponseType(typeof(BlogPostModel))]
      public IHttpActionResult GetBlogPostModel(int id)
      {
          BlogPostModel blogPostModel = db.blogPostTb.Find(id);
          if (blogPostModel == null)
          {
              return NotFound();
          }
  
          return Ok(blogPostModel);
      }
  
      // PUT: api/BlogPost/5
      [ResponseType(typeof(void))]
      public IHttpActionResult PutBlogPostModel(int id, BlogPostModel blogPostModel)
      {
          if (!ModelState.IsValid)
          {
              return BadRequest(ModelState);
          }
  
          if (id != blogPostModel.ID)
          {
              return BadRequest();
          }
  
          db.Entry(blogPostModel).State = EntityState.Modified;
  
          try
          {
              db.SaveChanges();
          }
          catch (DbUpdateConcurrencyException)
          {
              if (!BlogPostModelExists(id))
              {
                  return NotFound();
              }
              else
              {
                  throw;
              }
          }
  
          return StatusCode(HttpStatusCode.NoContent);
      }
  
      [ResponseType(typeof(BlogPostModel))]
      public IHttpActionResult DeleteBlogPostModel(int id)
      {
          BlogPostModel blogPostModel = db.blogPostTb.Find(id);
          if (blogPostModel == null)
          {
              return NotFound();
          }
  
          db.blogPostTb.Remove(blogPostModel);
          db.SaveChanges();
  
          return Ok(blogPostModel);
      }
  }
  </code></pre>
  
  <p>And here is the client side code:</p>
  
  <pre><code>var updateBlogPost = function (id, blogPost) {
          return $http.put(blogPostsUrl+"/"+id, blogPost)
              .then(function (response) {
                  return response;
              })
  </code></pre>
  
  <p>Just for the info,I am working with WebAPI2, IIS Express 10 in Visual Studio Community 2015. I am not sure if this is the error of IIS EXpress 10 or Community version of VS.</p>