the below code is cors using springs we set to accept:application/json on springs,
my url:http://localhost:8383/
server urls is:http://192.168.0.10:8080/
var menucategory = angular.module("menucategory", ['myApps']);
menucategory.config(['$
$scope.menucategoryfunction = function(menuForm) {
console.log("+++++++++" + angular.toJson($scope.
var data1 = {
category_name: "Hello world"
};
var jscon = JSON.stringify('category_name'
var ssss = JSON.stringify({category_name: 'sandeep kumar jollu'});
console.log("****" + ssss);
var promise = $http({
"method": "post",
"url": "http://192.168.0.10:8080/com.
data:$scope.menuForm,
data: {
category_name: menuForm.category_name
},
headers: {
"Content-Type": "application/json"
});
promise.success(function(data, status, headers, config, statusText) {
console.log("success: " + JSON.stringify(data));
console.log("2: " + JSON.stringify(status));
console.log("3: " + JSON.stringify(headers));
console.log("4: " + JSON.stringify(config));
console.log("statusText: " + JSON.stringify(statusText));
});
promise.error(function(data, status, headers, config) {
console.log("data: " + JSON.stringify(data));
console.log("status: " + JSON.stringify(status) + status);
console.log("headers: " + JSON.stringify(headers));
console.log("config: " + JSON.stringify(config));
});
};
}]);
댓글 없음:
댓글 쓰기