title: Post data to RESTful Invalid HTTP status code 405
body: <p>I create a method to post json data to web service :</p>
  
  <pre><code> function WishList() { }
   WishList.prototype.addToWishList = function(redirectURL, postURL, userObj) {
      $.ajax({
             type: "POST",
             url: postURL,
             data: JSON.stringify(userObj),
             dataType: 'json',
             contentType: "application/json",
             success: function(data){alert(data);},
             failure: function(errMsg) {
                alert(errMsg);
             }
   }
  
   This is my object:
  
   var user1 = {
              ID:1,
              Sex:1,
              Name:"titi",
              Company:"ABC",
              Address:"Phnom Penh",
              Email:"test.abc@gmail.com",
              Phone:"011123456",
              WebAccount:"test.abc@gmail.com",
              Password:"123456",
              GroupCustomerID:125,
              Stars:1,
              IsVIP:0,
              PriceLevel:1,
              LastDateSale:"\/Date(-62135596800000)\/",
              TotalCredit:150.12,
              AgingData:null,
              TotalRedeemPoint:1000.00,
              RedeemData:null,
              ExchangeRate:155.00,
              HistoryData:null
          };          
  
   Calling function :
  
   $(document).ready(function () { 
      var myWishList = new WishList();
      $('#addToWishList').click(function(){
         myWishList.addToWishList('http://www.blahblahblah.com' , 'http://blahblah/Website/Products/Product.svc/Wishlist/' , user1);
      });
   });
  </code></pre>
  
  <p>Then I got errors in my console :
  <code>"NetworkError: 405 Method Not Allowed</code> in <code>firefox</code> and <code>Invalid HTTP status code 405 , XMLHttpRequest cannot load url</code> in <code>chrome</code>.</p>
  
  <p>Note: When I use <code>Rest Client</code> of Chrome to <code>POST</code> to web service, it worked.</p>
  
  <p>Any help would be much appreciated, thank you.</p>