0
这里传递一个数据表到WCF服务是使用了数据表中要求我的WCF服务:我想用angularjs
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "/checkout",
BodyStyle = WebMessageBodyStyle.Bare,
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json)]
void Checkout(UserDetails data);
这是我的客户端代码:
$scope.checkout = function() {
var data = {
"MemberID": "2500394300",
"CategoryID": "1",
"ProductID": "1",
"PointValue": "100"
};
$http.post(
"url",
data,
{
headers: {
'Content-Type': 'application/json'
}
}
).success(function (result) {
alert(result);
});
}
您应该使用json数据以方便使用。 – Chandermani