本文整理匯總了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`)
}