riorio
riorio

Reputation: 6826

How to pass a parameter to a Spring Cloud Function?

I'm following the Spring Cloud Function tutorial.

In the example, they are calling the revert bean with this command:

curl localhost:8080/reverseString -H "Content-Type: text/plain" -d "abc"

I like to call the endpoint from a browser/postman as a GET request.

So I was looking to orchestrate a URL with a query parameter, that may look like localhost:8080/reverseString?input=abc

But:

  1. It is not clear to me what should be the name of the parameter?
  2. Seems like no matter what method name we put, they all get HTTP 200 response, with no response body. reverseStringggg, reve ...

Upvotes: 1

Views: 630

Answers (1)

Oleg Zhurakousky
Oleg Zhurakousky

Reputation: 6126

You can pass it as localhost:8080/reverseString/abc

That said, I've raise the issue to explicitly support http parameters - https://github.com/spring-cloud/spring-cloud-function/issues/864

Upvotes: 1

Related Questions