本文整理匯總了TypeScript中services/rest-client.RestClient類的典型用法代碼示例。如果您正苦於以下問題:TypeScript RestClient類的具體用法?TypeScript RestClient怎麽用?TypeScript RestClient使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了RestClient類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: addTask
addTask(tagId: number, taskTitle: string) {
let task = {
tagId: tagId,
title: taskTitle
};
return this.rest.post(Router.AddTask, task);
}
示例2: register
register(email: string, displayName: string, password: string) {
let registerDTO = {
email: email,
displayName: displayName,
password: password
};
return this.rest.post(Router.Register, registerDTO);
}
示例3: login
login(email: string, password: string) {
let loginDTO = {
grant_type: 'password',
userName: email,
password: password
};
return this.rest.postForm(Router.Token, loginDTO)
.then(response => {
let token = response.access_token;
if (token != null) {
return token;
}
throw response;
});
}
示例4: patchTask
patchTask(task: Object) {
return this.rest.patch(Router.UpdateTask(task['id']), task);
}
示例5: getTask
getTask(taskId: number) {
return this.rest.get(Router.GetTask(taskId));
}
示例6: createNewBoard
createNewBoard(teamId: number, board: Object) {
return this.rest.post(Router.CreateNewBoard(teamId), board);
}
示例7: addNewTag
addNewTag(boardId: number, tag: Object) {
return this.rest.post(Router.AddNewTag(boardId), tag);
}
示例8: getTagsWithTasks
getTagsWithTasks(boardId: number) {
return this.rest.get(Router.BoardTagsWithTasks(boardId));
}
示例9: getMe
getMe() {
return this.rest.get(Router.Me);
}
示例10: getStatus
getStatus() {
return this.rest.get(Router.Status);
}