我想构造以下请求
http://www.example-server.com/{{param-1}}/{{param-2}}/example
这是实际的请求
$http({
method:'POST',
url:"http://www.example-server.com/server/request/example",
data : {
phone: $scope.phone,
company: $scope.company,
contract: '1',
privacy: '1',
email: $scope.email
},
headers: {
'Content-Type': 'application/json'
}
})这是我想要构建的请求
$http({
method:'POST',
url:"http://www.example-server.com/{{param-1}}/{{param-2}}/example",
data : {
phone: $scope.phone,
company: $scope.company,
contract: '1',
privacy: '1',
email: $scope.email
},
headers: {
'Content-Type': 'application/json'
}
})发布于 2016-07-08 03:29:42
尝尝这个
var1 = "path1";
var2 = "path2";
$http({
method:'POST',
url:"http://www.example-server.com/" + var1 + "/" + var2 + "/example",
data : {
phone: $scope.phone,
company: $scope.company,
contract: '1',
privacy: '1',
email: $scope.email
},
headers: {
'Content-Type': 'application/json'
}
})https://stackoverflow.com/questions/38253592
复制相似问题