本文整理汇总了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);
}