http_post
Send HTTP POST requests with customizable headers, query parameters, and data payloads in JSON or text format to interact with web APIs and services.
Instructions
执行 HTTP POST 请求。
Args:
url (str): 请求的目标 URL。
query (Dict[str, str | int | float], optional): 可选参数,查询参数键值对。参数值会自动转换为字符串,并且会拼接到 url 里。
例如: {'key1': 'value1', 'key2': 2}会被转换为key1=value1&key2=2,并拼接到 url。
headers (Dict[str, str], optional): 可选参数,自定义的 http 请求头。
data (str, optional): 可选参数,要发送的 http 请求体数据,必须是文本,data 和 json 参数不能同时使用。
json (Any, optional): 可选参数,要发送的 http 请求体数据,以 JSON 数据,会自动序列化为JSON字符串,data 和 json 参数不能同时使用。
Returns:
str: 标准HTTP响应格式的字符串,包含状态行、响应头和响应体。
Input Schema
Name | Required | Description | Default |
---|---|---|---|
data | No | ||
headers | No | ||
json | No | ||
query | No | ||
url | Yes |
Input Schema (JSON Schema)
{
"properties": {
"data": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Data"
},
"headers": {
"anyOf": [
{
"additionalProperties": {
"type": "string"
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"title": "Headers"
},
"json": {
"anyOf": [
{},
{
"type": "null"
}
],
"default": null,
"title": "Json"
},
"query": {
"anyOf": [
{
"additionalProperties": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
}
]
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"title": "Query"
},
"url": {
"title": "Url",
"type": "string"
}
},
"required": [
"url"
],
"title": "http_postArguments",
"type": "object"
}