接口: HttpService
目录
Since
0.2.0
方法
get
▸ get(url): Promise<unknown>
向后台服务执行HTTP GET请求。
ddClient.extension.vm.service
.get("/some/service")
.then((value: any) => console.log(value)参数
| Name | Type | Description |
|---|---|---|
url | string | The URL of the backend service. |
返回
Promise<unknown>
post
▸ post(url, data): Promise<unknown>
向后台服务执行HTTP POST请求。
ddClient.extension.vm.service
.post("/some/service", { ... })
.then((value: any) => console.log(value));参数
| Name | Type | Description |
|---|---|---|
url | string | The URL of the backend service. |
data | any | The body of the request. |
返回
Promise<unknown>
put
▸ put(url, data): Promise<unknown>
向后端服务执行HTTP PUT请求。
ddClient.extension.vm.service
.put("/some/service", { ... })
.then((value: any) => console.log(value));参数
| Name | Type | Description |
|---|---|---|
url | string | The URL of the backend service. |
data | any | The body of the request. |
返回
Promise<unknown>
patch
▸ patch(url, data): Promise<unknown>
向后台服务执行HTTP PATCH请求。
ddClient.extension.vm.service
.patch("/some/service", { ... })
.then((value: any) => console.log(value));参数
| Name | Type | Description |
|---|---|---|
url | string | The URL of the backend service. |
data | any | The body of the request. |
返回
Promise<unknown>
delete
▸ delete(url): Promise<unknown>
向后台服务执行HTTP DELETE请求。
ddClient.extension.vm.service
.delete("/some/service")
.then((value: any) => console.log(value));参数
| Name | Type | Description |
|---|---|---|
url | string | The URL of the backend service. |
返回
Promise<unknown>
head
▸ head(url): Promise<unknown>
向后端服务执行HTTP HEAD请求。
ddClient.extension.vm.service
.head("/some/service")
.then((value: any) => console.log(value));参数
| Name | Type | Description |
|---|---|---|
url | string | The URL of the backend service. |
返回
Promise<unknown>
request
▸ request(config): Promise<unknown>
向后台服务执行HTTP请求。
ddClient.extension.vm.service
.request({ url: "/url", method: "GET", headers: { 'header-key': 'header-value' }, data: { ... }})
.then((value: any) => console.log(value));参数
| Name | Type | Description |
|---|---|---|
config | RequestConfig | The URL of the backend service. |
返回
Promise<unknown>