website/docs/segments/web/http.mdx
HTTP Request is a simple segment to return any json data from any HTTP call.
import Config from "@site/src/components/Config.js";
<Config data={{ type: "http", style: "diamond", foreground: "#ffffff", background: "#c386f1", leading_diamond: "\ue0b6", trailing_diamond: "\uE0B0", template: "{{ .Result }}", options: { url: "https://jsonplaceholder.typicode.com/posts/1", method: "GET", }, }} />
| Name | Type | Default | Description |
|---|---|---|---|
url | string | `` | The HTTP URL you want to call, supports templates |
method | string | GET | The HTTP method to use, GET or POST |
http_timeout | int | 10000 | The timeout in milliseconds for the HTTP request |
:::note default template
{{ .Body }}
:::
| Name | Type | Description |
|---|---|---|
.Body.property | string | Replace .property with the property you want to display |