Object built-in object

ObjectHttpHandler

httpprotocol conversion processor

used to convert the data stream intohttpProtocol message, creation method:

1
var hdlr = new mq.HttpHandler(...);

or:

1
var hdlr = new http.Handler(...);

inheritance relationship

Constructor

HttpHandler

CreatehttpProtocol handler object, converts the data of the stream object intohttpmessage object

1
new HttpHandler(Handler hdlr);

Call parameters:

  • hdlr:Handler, built-in message processor, processing function, chain processing array, routing object, see detailsmq.Handler

member properties

maxHeadersCount

Integer, query and set the maximum number of request headers, the default is 128

1
Integer HttpHandler.maxHeadersCount;

maxHeaderSize

Integer, query and set the maximum request header length, the default is 8192

1
Integer HttpHandler.maxHeaderSize;

maxBodySize

Integer, query and set the maximum body size in MB, the default is 64

1
Integer HttpHandler.maxBodySize;

enableEncoding

Boolean, automatic decompression function switch, turned off by default

1
Boolean HttpHandler.enableEncoding;

serverName

String, query and set the server name, the default is: fibjs/0.x.0

1
String HttpHandler.serverName;

handler

Handler,httpProtocol conversion processor current event processing interface object

1
Handler HttpHandler.handler;

member function

enableCrossOrigin

Allow cross-domain requests

1
HttpHandler.enableCrossOrigin(String allowHeaders = "Content-Type");

Call parameters:

  • allowHeaders: String, specified to be acceptedhttpheader field

invoke

Process a message or object

1
Handler HttpHandler.invoke(object v) async;

Call parameters:

  • v:object, specify the message or object to be processed

Return results:

  • Handler, return to the next processor

toString

Returns the string representation of the object. Generally, "[Native Object]" is returned. The object can be re-implemented according to its own characteristics.

1
String HttpHandler.toString();

Return results:

  • String, returns the string representation of the object

toJSON

Returns a JSON format representation of the object, generally returning a collection of readable properties defined by the object.

1
Value HttpHandler.toJSON(String key = "");

Call parameters:

  • key: String, not used

Return results:

  • Value, returns a value containing JSON serializable