0
我试着做一个post
请求采用了棱角分明JS角JS HTTP请求到.NET服务器
.NET服务器我能够得到回应,但服务器没有看到我的请求数据。
客户:
var header = {"Content-Type":"multipart/form-data"};
var data = {name:"bill", email:"[email protected]", phone:"1234567890" };
$http.post("//dot.net/resource", data, header).then(function(res){
console.log(res.data);
},function(err){ console.log(err); });
服务器:
if(HttpContext.Current.Request.HttpMethod.ToString().ToLower() == "post") {
Response.Write("hello request"); // I see this in the response
Response.Write(Request.Form["name"]); // nothing : (
}
我不是超级熟悉的.NET
。是Request.Form
基本上像$_POST
在PHP?
如何使用$http
将某些变量传递给服务器?