HTTP
What
HTTP Request is a simple segment to return any json data from any HTTP call.
Sample Configuration
- json
- yaml
- toml
{
"type": "http",
"style": "diamond",
"foreground": "#ffffff",
"background": "#c386f1",
"leading_diamond": "",
"trailing_diamond": "",
"template": "{{ .Result }}",
"properties": {
"url": "https://jsonplaceholder.typicode.com/posts/1",
"method": "GET"
}
}
type: http
style: diamond
foreground: "#ffffff"
background: "#c386f1"
leading_diamond:
trailing_diamond:
template: "{{ .Result }}"
properties:
url: https://jsonplaceholder.typicode.com/posts/1
method: GET
type = "http"
style = "diamond"
foreground = "#ffffff"
background = "#c386f1"
leading_diamond = ""
trailing_diamond = ""
template = "{{ .Result }}"
[blocks.segments.properties]
url = "https://jsonplaceholder.typicode.com/posts/1"
method = "GET"
Properties
Name | Type | Default | Description |
---|---|---|---|
url | string | `` | The HTTP URL you want to call, supports templates |
method | string | GET | The HTTP method to use |
Template (info)
default template
{{ .Body }}
Properties
Name | Type | Description |
---|---|---|
.Body.property | string | Replace .property with the property you want to display |