本文整理汇总了TypeScript中base/fetch.fetchClient类的典型用法代码示例。如果您正苦于以下问题:TypeScript fetchClient类的具体用法?TypeScript fetchClient怎么用?TypeScript fetchClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了fetchClient类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: addSubReply
export function addSubReply(comment: string, obj) {
return fetchClient.post(`/comments/add-sub/${comment}/`, {
headers: new Headers({
'Content-Type': 'application/x-www-form-urlencoded'
}),
body: paramPostBody(obj)
})
}
示例2: getLinks
export function getLinks() {
return fetchClient.get('/links/?format=json')
}
示例3: getHeadSubComments
export function getHeadSubComments(head: string) {
return fetchClient.get(`/comment/subcomments/${head}/?format=json`)
}
示例4: getCommentList
export function getCommentList(article: string) {
return fetchClient.get(`/comment/comments/${article}/?format=json`)
}
示例5: getAllComments
export function getAllComments() {
return fetchClient.get('/comments/?format=json')
}
示例6: getUserSubComments
export function getUserSubComments(user: string) {
return fetchClient.get(`/comment/subcomments/${user}/?format=json`)
}
示例7: getList
export function getList(category: string, page: number = 1) {
return fetchClient.get(`/article/articles/${category}/?format=json&page=${page}`)
}
示例8: getCategories
export function getCategories() {
return fetchClient.get('/article/categories/?format=json')
}
示例9: getDetail
export function getDetail(url: string) {
return fetchClient.get(`/article/${url}/?format=json`)
}