Skip to content

http/rs/resource-method

Documentation

Overview

Classes

ResourceMethod

execute()

Delegates to the HttpController's execute function to process the request.

ts
execute(): void;

Returns

  • Type: void
  • Description:

get()

Delegates to the parent Resource's 'get' method.

ts
get(): any;

Returns

  • Type: any
  • Description:

post()

Delegates to the parent Resource's 'post' method.

ts
post(): any;

Returns

  • Type: any
  • Description:

put()

Delegates to the parent Resource's 'put' method.

ts
put(): any;

Returns

  • Type: any
  • Description:

delete()

Delegates to the parent Resource's 'delete' method.

ts
delete(): any;

Returns

  • Type: any
  • Description:

remove()

Delegates to the parent Resource's 'remove' method.

ts
remove(): any;

Returns

  • Type: any
  • Description:

method()

Delegates to the parent Resource's 'method' method.

ts
method(): any;

Returns

  • Type: any
  • Description:

configuration()

Returns the configuration object for this ResourceMethod instance.

ts
configuration(): ResourceMethodConfig;

Returns

  • Type: ResourceMethodConfig
  • Description: The configuration object.

before()

Applies a callback function for the before phase of processing a matched resource request.

ts
before(fHandler: Function): ResourceMethod;
ParameterTypeDescription
fHandlerFunctionCallback function for the before phase.

Returns

  • Type: ResourceMethod
  • Description: The ResourceMethod instance for method chaining.

serve()

Applies a callback function for processing a matched resource request (serve phase).

ts
serve(fHandler: Function): ResourceMethod;
ParameterTypeDescription
fHandlerFunctionCallback function for the serve phase.

Returns

  • Type: ResourceMethod
  • Description: The ResourceMethod instance for method chaining.

catch()

Applies a callback function for the catch errors phase of processing a matched resource request.

ts
catch(fHandler: Function): ResourceMethod;
ParameterTypeDescription
fHandlerFunctionCallback function for the catch phase.

Returns

  • Type: ResourceMethod
  • Description: The ResourceMethod instance for method chaining.

finally()

Applies a callback function for the finally phase of processing a matched resource request.

ts
finally(fHandler: Function): ResourceMethod;
ParameterTypeDescription
fHandlerFunctionCallback function for the finally phase.

Returns

  • Type: ResourceMethod
  • Description: The ResourceMethod instance for method chaining.

consumes()

Defines the content MIME type(s), which this ResourceMethod expects as input (consumes).

ts
consumes(mimeTypes: any): ResourceMethod;
ParameterTypeDescription
mimeTypesanySets the mime types that this ResourceMethod is capable to consume.

Returns

  • Type: ResourceMethod
  • Description: The ResourceMethod instance for method chaining.

produces()

Defines the HTTP response payload MIME type(s), which this ResourceMethod request processing function outputs, i.e. those that it 'produces'. At runtime, the Accept request header will be matched for compatibility with this setting to elicit request processing functions. Note that the matching is performed by compatibility, not strict equality, i.e. the MIME type format wildcards are considered too. For example, a request Accept header "*/json" will match a produces setting "application/json".

ts
produces(mimeTypes: any): ResourceMethod;
ParameterTypeDescription
mimeTypesanySets the mime type(s) that this ResourceMethod may produce.
  • |

Returns

  • Type: ResourceMethod
  • Description: The ResourceMethod instance for method chaining.