AngularJS - $http.put server request

How to update data on the server using HttpPut method in AngularJS?


Syntax of $http.put Method:

$http.put(url, data, config)
            .success(function (data, status, headers, config) {
            })
            .error(function (data, status, header, config) {
            });

Parameters are 

                    Url - url to send  request to
                    Data - data to send 
                    Config - configuration to use while sending data


  $http.put('/api/Default?'+ data)
            .success(function (data, status, headers) {
                $scope.ServerResponse = data;
console.log(data);                       //browser inspect Element Console Data passing Show 
            })
            .error(function (data, status, header, config) {
                $scope.ServerResponse =  htmlDecode("Data: " + data +
                    "\n\n\n\nstatus: " + status +
                    "\n\n\n\nheaders: " + header +
                    "\n\n\n\nconfig: " + config);
            });

$http mean web services Url declared to config file.






AngularJS - $http.put server request Dev2Tricks 5 of 5
How to update data on the server using HttpPut method in AngularJS? Syntax of $http.put Method: $http.put(url, data, config) ...

Share this

Related Posts

Previous
Next Post »