本文整理汇总了TypeScript中axios.get函数的典型用法代码示例。如果您正苦于以下问题:TypeScript get函数的具体用法?TypeScript get怎么用?TypeScript get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getMessage
public async getMessage(id: string): Promise<Message> {
return (await axios.get(this.getMessage_url(id), null || undefined)).data as Message;
}
示例2:
export const systemThreadDump = () => ({
type: ACTION_TYPES.FETCH_THREAD_DUMP,
payload: axios.get('management/threaddump')
});
示例3:
export const getRoles = () => ({
type: ACTION_TYPES.FETCH_ROLES,
payload: axios.get(`${apiUrl}/authorities`)
});
示例4: stream
export function stream(url: string, headers: any): Promise<Readable> {
headers["User-Agent"] = userAgent;
return axios
.get(url, { headers, responseType: "stream" })
.then(res => res.data as Readable);
}
示例5:
export const getSearchEntities: ICrudSearchAction<ICustomerRelation> = query => ({
type: ACTION_TYPES.SEARCH_CUSTOMERRELATIONS,
payload: axios.get<ICustomerRelation>(`${apiSearchUrl}?query=` + query)
});
示例6: Date
export const getEntities: ICrudGetAllAction<ICurrentMessage> = (page, size, sort) => ({
type: ACTION_TYPES.FETCH_CURRENTMESSAGE_LIST,
payload: axios.get<ICurrentMessage>(`${apiUrl}?cacheBuster=${new Date().getTime()}`)
});
示例7: dispatch
export const getSession = () => dispatch =>
dispatch({
type: ACTION_TYPES.GET_SESSION,
payload: axios.get('uaaserver/api/account')
});
示例8: getMessageHtml
public async getMessageHtml(id: string): Promise<string> {
return (await axios.get(this.getMessageHtml_url(id), null || undefined)).data as string;
}