Aller au contenu principal

HTTP

Traduction Bêta Non Officielle

Cette page a été traduite par PageTurner AI (bêta). Non approuvée officiellement par le projet. Vous avez trouvé une erreur ? Signaler un problème →

Description

Le segment HTTP est un composant simple permettant de récupérer des données JSON depuis n'importe quel appel HTTP.

Exemple de configuration

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

Options

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

Modèle (info)

modèle par défaut
 {{ .Body }}

Propriétés

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