Skip to content

Allow passing argument to subrequest #563

Description

@lostb1t

Description

For some of my custom widgets i need to make a secondary requestt based on the result of the main request. But i cannot make subrequest with runtime arguments:

example

        - type: custom-api
          title: Crowdsec
          url: http://100.95.200.149:8090/v1/decisions
          subrequests:
            ipinfo:
               url: getip.com/{{IP}}
          template: |
            <ul class="list list-gap-5 collapsible-container" data-collapse-after="5">
            {{ range .JSON.Array "" | sortByInt "id" "asc" }}
            <li>scenario: {{ .Int "id" }} decision: {{ .String "type" }} ip: {{ .String "value" }}

            {{ $hb := .Subrequest "ipinfo" .Int “value” }}

            country: {{ hb.String "country" }}

</li>
            {{ end }}
            </ul>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions