我在WSO2 ESB中内置了其他API。 这是我为POST方法服务的请求。
createUser: function(aUser) {
var myCreateUserRequest = {
"User": {
"UserName": aUser.Username,
"UserPassword": aUser.Password,
"OrganizationId": aUser.OrgId,
"UserStatus": "Active", }}
//API Call
var promise = $http.post(API_URL,myCreateUserRequest,REQUEST_HEADER).then(
function(aCreateUserResponse) {
return [aCreateUserResponse.data.CreateUserResponse.Result.ResponseCode,''];
});
return promise; },
现在同样我想只传递2个参数给GET用户,即UserName和Organization id。我怎么能在角度js做到这一点? 到目前为止我实施的是:
getUser: function() {
params = {"UserName": aUser.Username, "OrganizationId": aUser.OrgId}
//API Call
var promise = $http.get(API_URL,params,REQUEST_HEADER).then(
function(aGetUserResponse) {
return [aGetUserResponse.data.GetUserResponse.Result,''];
});
return promise; },
这是正确的方法,我该怎么做?