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.

    public interface HttpFunction
    Represents a Cloud Function that is activated by an 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 any Error) then the HTTP response will have a 500 status code.
        request - a representation of the incoming HTTP request.
        response - an object that can be used to provide the corresponding HTTP response.
        java.lang.Exception - if thrown, the HTTP response will have a 500 status code.