Skip to content

feat: implement query() for FuncCallHttpStep #1301

@domhanak

Description

@domhanak

What would you like to be added:

return FuncWorkflowBuilder.workflow("http-query-headers")
            .tasks(
                call("searchStarWarsCharacters")
                    .http(Method.GET, "https://swapi.dev/api/people/")
                    .query("search", "${ .searchQuery }") // Add this
                    .header("Accept", "application/json")
            )
            .build();

Why is this needed:
In order to simplify how we write code for HTTP calls.
Currently working option:

return FuncWorkflowBuilder.workflow("http-with-query-headers")
                .tasks(
                        call("searchStarWarsCharacters",
                                http()
                                        .GET()
                                        // query(...) is not supported yet, include the query in the URI
                                        // engine will replace  values in {} if they match the task input
                                        .endpoint("http://localhost:8089/api/people/?search={searchQuery}")
                                        // Accept value is taken from workflow input, jq expression is used
                                        .header("Accept", "${ .acceptHeaderValue }")
                                        // export the results of the GET request as taskOutput
                                        .exportAsTaskOutput()))
                .build();

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions