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