request.headers()
Access:
public

This is the headers class. With this class you can get the headers that were sent by the client.

Summary

Name
Description
get
Returns the specified header.
has
Checks if the header exists.
Returns an array of all the headers.

Functions

.get()
Access:
public
Summary:
Returns the specified header.

With this function you can get a certain header that has been sent by the client. You specify the header you want to get using the key parameter. If the key parameter isn't a string it'll throw a TypeError and when the header wasn't found it'll return undefined.

Returns

Type
String
Description
The specified header.
.has()
Access:
public
Summary:
Checks if the header exists.

This function returns if the client has sent the specified header. You can specify the header you want to check using the key parameter. If the key parameter isn't a string it'll throw a TypeError.

Returns

Type
Boolean
Description
If the header exists.
.list()
Access:
public
Summary:
Returns an array of all the headers.

This function returns an array of the names of all the headers that were sent by the client.

Returns

Type
String[]
Description
An array of all the headers.