Handles HTTP requests for a specific method (e.g., “GET”) to a specific
Endpoint by assigning to a property on the endpoint that corresponds to that HTTP method (e.g.
get). This can be instantiated explicitly in the context of an
Endpoint or implicitly if just a handler method is provided. In the latter case, the operation object will be built and instantiated for you.
Default undefined Description A brief description of what this operation does. This will be displayed in any generated documentation.
endpoint Required Description xxx
Description The operation name (i.e., HTTP method)
Description Any parameters that are specific to this operation (as opposed to those defined on the parent endpoint)
Description Response definitions for this operation. These will be used for validation purposes as well as generated static documentation.
getAllParameters Return type Object.<string, carbond.OperationParameter> Description Gets all parameters defined for this
Operationwhich includes all parameters inherited from this.endpoint
- req (http.ClientRequest) – the current request
Returns the sanitized URL Return type string Description Returns a new URL with the query string portion removed
handle Deprecated Arguments Throws
Return type Object | null | undefined Description Handles incoming requests, generating the appropriate response. Responses can be sent by the handler itself or this can be delegated to the service. If an object is returned, it will be serialized (and validated if configured to do so) and sent as the body of the response. If
nullis returned, it will end the response. If
undefinedis returned, it will be the responsibility of the handler to end the response. If the response status code is something other than
204, it should be set by the handler. Additionally, custom headers should be set on the response object before returning. To respond with an error (status code > 400), an instance of
HttpErrorcan be thrown.