跳转到主内容

HTTP

非官方测试版翻译

本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →

功能

HTTP 请求是一个简单模块,可从任何 HTTP 调用返回 JSON 数据。

示例配置

{
"type": "http",
"style": "diamond",
"foreground": "#ffffff",
"background": "#c386f1",
"leading_diamond": "",
"trailing_diamond": "",
"template": "{{ .Result }}",
"options": {
"url": "https://jsonplaceholder.typicode.com/posts/1",
"method": "GET"
}
}

选项

NameTypeDefaultDescription
urlstring``The HTTP URL you want to call, supports templates
methodstringGETThe HTTP method to use, GET or POST

模板 (信息)

默认模板
 {{ .Body }}

属性

NameTypeDescription
.Body.propertystringReplace .property with the property you want to display