# request-请求
调用request函数发送请求。
最小支持版本:5.0.0
# 语法
HttpAction.request(<url>, <method>, <header>, <customHeader>, <body>, <timeout>, <allowRedirects>)
1
HttpAction.请求(<url>, <method>, <header>, <customHeader>, <body>, <timeout>, <allowRedirects>)
1
# 函数类型
静态函数
# 请求参数
参数名称 | 类型 | 是否必选 | 默认值 | 示例值 | 描述 |
---|---|---|---|---|---|
url | Cube.Lang.String | 是 | 无 | “https://www.baidu.com” | 下载地址。 |
method | Cube.Lang.String | 是 | 无 | “post” | 请求方式。 |
header | Cube.Lang.KeyValue | 是 | 无 | {"content-type": "text/css"} | 请求头。 |
customHeader | Cube.Lang.KeyValue | 是 | 无 | {} | 自定义请求头。 |
body | Cube.Lang.String | 是 | 无 | "" | 请求体。 |
timeout | Cube.Lang.Number | 是 | 无 | 5 | 超时时间。单位:秒。 |
allowRedirects | Cube.Lang.Boolean | 是 | true | true | 是否允许重定向。取值: true:是 false:否 |
# 返回参数
参数名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Result | Cube.Protocol.HTTP.HttpResponse | Cube.Protocol.HTTP.HttpResponse | 响应对象。 |
# 请求示例
HttpAction.authUpload(“https://www.baidu.com”,“post”,{"content-type": "text/css"},{},"",5,true)
1
最近更新时间: {
"value": "2023-09-12",
"effect": true
}