MST
星途 面试题库
面试题:TypeScript 中如何定义一个用于封装 RESTful API 客户端的基础接口
在 TypeScript 封装 RESTful API 客户端的场景下,请定义一个基础接口,该接口需包含发送 GET 请求的方法定义,方法接收一个 URL 字符串参数,返回值为 Promise 类型,Promise 解析值为 any 类型。
30.6万 热度
难度
前端开发
TypeScript
知识考点
面试题答案
一键面试
interface RestfulAPIClientBase { get(url: string): Promise<any>; }