RequestInfo class

const requestInfo = new RequestInfo(data: ClientRequest, body: string | null);


The constructor of the RequestInfo class requires two arguments. The first argument must be an instance of the NodeJS built-in HTTP IncomingMessage class which provides the data of the request. The second argument must be a type of string or null and is the body which the client provided during the request.



The url where the request was made to by the client.


The method the client used (either GET or POST)


An object with the headers which the client provided in the request where the key of the object the name of the header is and the value the value of the header.


An instance of the NodeJS built-in URLSearchParams class which provides the parameters provided by the client in the request.


When the request method is POST, a string with the provided body data of the client.


A string which defines the IP address where the request was made from.


An array with the values of the placeholders which have been set in the get or post EventEmitters of the HTTPServer class. The values are in the same order as the placeholders were set in the get or post EventEmitters.

Last updated