WARNING: This server provides a static reference view of the NetKernel documentation. Links to dynamic content do not work. For the best experience we recommend you install NetKernel and view the documentation in the live system .

HttpAccessorImpl

A specialist convenience base class is provided for implementing HTTP-specific endpoints.

org.netkernel.http.transport.HttpAccesorImpl

This class extends NKF's StandardAccessorImpl base class to provide a high-level convenience base class for responding specifically to HTTP initiated requests.

By extending this base class you can override the following methods with specific handler code for each of the possible HTTP verbs GET, POST, PUT, DELETE, PATCH and HEAD...

  public void onGet(INKFRequestContext aContext) throws Exception
  { 
  }
  public void onPost(INKFRequestContext aContext) throws Exception
  { 
  }
  public void onDelete(INKFRequestContext aContext) throws Exception
  { 
  }
  public void onPut(INKFRequestContext aContext) throws Exception
  { 
  }
  public void onPatch(INKFRequestContext aContext) throws Exception
  { 
  }
  public void onHead(INKFRequestContext aContext) throws Exception
  { 
  }

When an HTTP request is resolved to your accessor the HTTP verb will be SOURCEd from httpRequest:/method and the corresponding onXXXX method is invoked.

If a specific HTTP onXXXX is not implemented, the accessor will automatically sink a 405 response to the HttpBridge and set the HTTP Allow header with the supported methods.

Note: The HttpAccessorImpl assumes that the HttpBridgeOverlay is in the request call stack.