doc: request
This commit is contained in:
parent
a9b2ffaf78
commit
ff01cc70c0
@ -75,6 +75,32 @@ export const getFooAPI2 = (name: string) => {
|
|||||||
|
|
||||||
依然非常简洁,深受妹子喜爱。
|
依然非常简洁,深受妹子喜爱。
|
||||||
|
|
||||||
|
> 完成范例如下
|
||||||
|
|
||||||
|
```ts
|
||||||
|
/** GET 请求 */
|
||||||
|
export const getFooAPI = (name: string) => {
|
||||||
|
return http.get<IFooItem>('/foo', { name })
|
||||||
|
}
|
||||||
|
/** GET 请求;支持 传递 header 的范例 */
|
||||||
|
export const getFooAPI2 = (name: string) => {
|
||||||
|
return http.get<IFooItem>('/foo', { name }, { 'Content-Type-100': '100' })
|
||||||
|
}
|
||||||
|
|
||||||
|
/** POST 请求 */
|
||||||
|
export const postFooAPI = (name: string) => {
|
||||||
|
return http.post<IFooItem>('/foo', { name })
|
||||||
|
}
|
||||||
|
/** POST 请求;需要传递 query 参数的范例;微信小程序经常有同时需要query参数和body参数的场景 */
|
||||||
|
export const postFooAPI2 = (name: string) => {
|
||||||
|
return http.post<IFooItem>('/foo', { name })
|
||||||
|
}
|
||||||
|
/** POST 请求;支持 传递 header 的范例 */
|
||||||
|
export const postFooAPI3 = (name: string) => {
|
||||||
|
return http.post<IFooItem>('/foo', { name }, { name }, { 'Content-Type-100': '100' })
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## 图片上传
|
## 图片上传
|
||||||
|
|
||||||
`template` 部分编码如下:
|
`template` 部分编码如下:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user