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();
What would you like to be added:
Why is this needed:
In order to simplify how we write code for HTTP calls.
Currently working option: