spring-cloud-function icon indicating copy to clipboard operation
spring-cloud-function copied to clipboard

Guidance: HTTP GET, PUT, DELETE support

Open ncoonghe opened this issue 6 years ago • 8 comments

I wasn't able to use HTTP GET to call a function, especially using the Supplier. It didn't seem to work. I was only able to get "functions" to work with HTTP POST. There is no proper documentation nohow Supplier interface can be used. I created a Supplier implementing the get interface, but was not able to invoke the get interface using HTTP GET. Any information on how to enable the Supplier mode with HTTP GET will be appreciated. Also, there seems to be no support for PUT and DELETE.

ncoonghe avatar Feb 07 '19 03:02 ncoonghe

@ncoonghe, I had the same problem (actually, I just wanted to try whether my functions implemented for AWS Lambda would also run as Spring Boot app without modifications). What you would have to do is to implement your custom versions of FunctionController and FunctionHandlerMapping. I created a quick tutorial here.

markusgulden avatar Feb 12 '19 18:02 markusgulden

@markusgulden Thanks. Hopefully, it can be provided as standard functionality

ncoonghe avatar Mar 19 '19 23:03 ncoonghe

Actually I am not quite sure what this is about. We certainly support GET and POST and there are plenty of samples for it. I must be missing something, am I?

olegz avatar Apr 03 '19 07:04 olegz

@olegz , my comment above mainly referred to the missing support of PUT and DELETE. However, I also was not able to call a Function via GET request (which actually is required if I want to pass something like HTTP path parameters to the function). This is why I hacked the FunctionController.

On the other points, the issue author should provide more information.

markusgulden avatar Apr 03 '19 17:04 markusgulden

@markusgulden @olegz is there support for path parameters with POST and GET ?

ncoonghe avatar May 21 '19 04:05 ncoonghe

It is 2021 and am I the only 1 looking for full-fledged REST API support with spring cloud functions? With spring native getting mature, I think more developers will be more interested in the option to writing REST API's [ with classic support for GET PUT POST PATCH DELETE ] using spring cloud functions. I am happy to open new thread if this is too old. Thank for your wonderful work.

chaudharydeepak avatar Mar 29 '21 17:03 chaudharydeepak

@olegz I am also looking for similar enhancement mentioned about where I need to use path parameters coming from HTTP GET request from AWS API gateway. Is this enhancement part of any upcoming milestones?

ividamileen avatar Feb 18 '22 13:02 ividamileen

Do we have updates? Is there a way to get the HTTP method used to hit the function?

Thank you

Premier avatar Feb 10 '23 12:02 Premier