## 类的使用
org.redkale.net.http.HttpRequest

- 使用HttpRequest的程序包
  程序包 | 说明
  --- | ---
  org.redkale.boot | 提供Redkale服务器的启动、初始化和加载功能
  org.redkale.net.http | HTTP协议包,提供HTTP协议服务器

- - ### org.redkale.boot中HttpRequest的使用

    参数类型为HttpRequest的org.redkale.boot中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `boolean` | ApiDocs.`authenticate(int moduleid, int actionid, HttpRequest request, HttpResponse response)`

  - ### org.redkale.net.http中HttpRequest的使用

    返回HttpRequest的org.redkale.net.http中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected HttpRequest` | HttpResponse.`getRequest()`

    参数类型为HttpRequest的org.redkale.net.http中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected void` | HttpBaseServlet.`addHeader(HttpRequest request, java.lang.String name, java.io.Serializable value)`
    `boolean` | DefaultRestServlet.`authenticate(int moduleid, int actionid, HttpRequest request, HttpResponse response)`
    `abstract boolean` | HttpBaseServlet.`authenticate(int moduleid, int actionid, HttpRequest request, HttpResponse response)`
    `protected java.lang.Object` | DefaultRestServlet.`currentUser(HttpRequest req)`
    `protected abstract T` | RestHttpServlet.`currentUser(HttpRequest req)`
    `void` | HttpBaseServlet.`execute(HttpRequest request, HttpResponse response)`
    `void` | HttpPrepareServlet.`execute(HttpRequest request, HttpResponse response)`
    `void` | HttpResourceServlet.`execute(HttpRequest request, HttpResponse response)`
    `void` | WebSocketServlet.`execute(HttpRequest request, HttpResponse response)`
    `java.io.Serializable` | WebSocket.`onOpen(HttpRequest request)` 返回sessionid, null表示连接不合法或异常,默认实现是request.getSessionid(false)，通常需要重写该方法
    `boolean` | HttpBaseServlet.`preExecute(HttpRequest request, HttpResponse response)`
    `protected void` | HttpBaseServlet.`setHeader(HttpRequest request, java.lang.String name, java.io.Serializable value)`

    参数类型为HttpRequest的org.redkale.net.http中的构造器
    构造器和说明
    `HttpResponse(HttpContext context, HttpRequest request, java.lang.String[][] defaultAddHeaders, java.lang.String[][] defaultSetHeaders, java.net.HttpCookie defcookie)`