title: How to allow POST, PUT on IIS 8.x or higher for both localhost and remote
body: <p>I'm using Angular 1.5 for my $http.POST() and everything is working fine but I keep getting this error:</p>
  
  <pre><code>**GENERAL**
  Request URL:http://localhost/ThingBlu/OmniGrow/js/json/logged-users.json
  Request Method:POST
  Status Code:405 Method Not Allowed
  Remote Address:[::1]:80
  
  **Response Headers**
  Allow:GET, HEAD, OPTIONS, TRACE
  Cache-Control:private
  Content-Length:5448
  Content-Type:text/html; charset=utf-8
  Date:Sun, 11 Sep 2016 18:08:27 GMT
  Server:Microsoft-IIS/10.0
  X-Powered-By:ASP.NET
  
  **Request Headers**
  Accept:application/json, text/plain, */*
  Accept-Encoding:gzip, deflate
  Accept-Language:en-US,en;q=0.8
  Authorization:Basic OWFjMTIwMTAtNjhmZC00YTY4LWIxMTQtMTI3NjcyYmRkMmNkOjRmOGJkMDg0LTY2NDQtNDVmMi1iNGI4LWI4OTgwNzgyMDkzZA==
  Connection:keep-alive
  Content-Length:305
  Content-Type:application/json;charset=UTF-8
  Cookie:XDEBUG_SESSION=XDEBUG_ECLIPSE; ASPSESSIONIDQARBBSBC=LGJPEMMBPPMIKGAEMPOKDDKP; ASPSESSIONIDQAQBBRDC=HNLHMCECDLFMFBMOFMNFNNEA; ASPSESSIONIDSARCBSBD=DMGPJIECDOKINIEIIADELBOG; ASPSESSIONIDSCQBCQCD=HHHNEBHCACCJABGNFAMFHNAD; ASPSESSIONIDQATBARBD=KFNLJLHCMOECJOMCDDOFBINL; ASPSESSIONIDQCSABTAC=GDGJMOMCNPDBJAAOKJJHDDGH
  DNT:1
  Host:localhost
  Origin:http://localhost
  Referer:http://localhost/ThingBlu/OmniGrow/index.html
  User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.101 Safari/537.36
  </code></pre>
  
  <p>Here's the problem:</p>
  
  <p>My WebConfig file has the following:</p>
  
  <pre><code>&lt;modules&gt;
      &lt;remove name="WebDAVModule" /&gt;
  &lt;/modules&gt;
  &lt;handlers&gt;
      &lt;remove name="WebDAV" /&gt;
  &lt;/handlers&gt;
  </code></pre>
  
  <p>What's happening is whenever I step through the code, below, and hit a specific part, the above error occurs.</p>
  
  <p>I'm writing to a local JSON file, WHICH I have successfully done when I worked for Frontier Communications.  It's VERY POSSIBLE much to the chagrin of most posts out there saying it's NOT.  I've done it and so does FRONTIER and T-MOBILE.  That being said, here's my ANGULAR code:</p>
  
  <pre><code>            /**
               * Then log the person in
               * @returns {object through promises}
               */
              ctrlLogin.fetchLogin = function () {
  
                  //SUBMIT FORM
                  $scope.submit = function () {
                      console.log('Submit Clicked');
                      //Encode Password if FormData is VALID
                      if ($scope.formData) {
                          formObj = {
                              uid: $scope.formData.myusername,
                              pwd: $scope.encode64($scope.formData.mypassword),
                              rmbr: $scope.formData.rememberme
                          };
                          //Login Data
                          loginData.svc.getLoginData(formObj).then(function (result) {
                              console.log("Login message: ", result);
                              //if success send the person through
                              if (result.data.message === "failure") {
                                  console.log("ERROR: ", result.data.message);
                                  $scope.changeRoute("/error");
                              } else {
                                  console.log("SUCCESS: ", result.data);
  
                                  //Get Path to JSON
                                  $http.get(SVCURLS.data.loggedusers).then(function (data) {
                                      //SUCCESS so therefore pass ACTIVE = 1 for DASHBOARD as that's
                                      //where we're going next.
                                      if (appservice.appFuncs.saveToJson(result.data, 1)) {
  
                                          data.users = angular.toJson(result.data);
                                          //use $.param JQUERY function to serialize the data from JSON
                                          $scope.users = $.param(data.users);
                                          //CONFIG using HEADERS
                                          var config = HEADERS.tokenheaders;
                                          **//NOTE: THIS IS THE POINT AT WHICH THE 405 ERROR OCCURS**
                                          $http.post(SVCURLS.data.loggedusers, data.users, status, config)
                                                  .success(function (data, status, headers, config) {
                                                      //SUCCESS CALBACK
                                                      $scope.PostDataResponse = data;
                                                      console.log("SUCCESS Writing to JSON FILE!");
                                                      window.location.href = "main-page.html";
                                                  })
                                                  .error(function (data, status, headers, config) {
                                                      //FAILURE CALLBACK
                                                      $scope.PostDataResponse = "DATA: " + data +
                                                              "&lt;hr/&gt;Status: " + status +
                                                              "&lt;hr/&gt;Headers: " + headers +
                                                              "&lt;hr/&gt;Config: " + config;
                                                      console.log("ERROR Writing to JSON FILE");
                                                      return deferred.reject(data ? data : '[NO DATA]');
                                                  });
                                      } else {
                                          //ERROR show what happened
                                          console.log("ERROR: ", data);
                                          //Now flip the pages that the session has been
                                          //Created
                                          $scope.msg = "There was an error saving your information.";
                                          deferred.reject(data ? data : '[NO DATA]');
                                      }
                                  });
                              }
                          });
                      }
                      return "intial load";
                  };
              };
              ctrlLogin.fetchLogin();
  </code></pre>
  
  <p>Help would be much appreciated. Thank you.</p>