Package com.google.cloud.functions
Interface HttpFunction
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface HttpFunction
Represents a Cloud Function that is activated by an HTTP request.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
service(HttpRequest request, HttpResponse response)
Called to service an incoming HTTP request.
-
-
-
Method Detail
-
service
void service(HttpRequest request, HttpResponse response) throws java.lang.Exception
Called to service an incoming HTTP request. This interface is implemented by user code to provide the action for a given function. If the method throws any exception (including anyError
) then the HTTP response will have a 500 status code.- Parameters:
request
- a representation of the incoming HTTP request.response
- an object that can be used to provide the corresponding HTTP response.- Throws:
java.lang.Exception
- if thrown, the HTTP response will have a 500 status code.
-
-