---
lang: en
title: 'API docs: rest.requestcontext._constructor_'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/rest
permalink: /doc/en/lb4/apidocs.rest.requestcontext._constructor_.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/rest](./rest.md) &gt; [RequestContext](./rest.requestcontext.md) &gt; [(constructor)](./rest.requestcontext._constructor_.md)

## RequestContext.(constructor)

Constructs a new instance of the `RequestContext` class

**Signature:**

```typescript
constructor(request: Request, response: Response, parent: Context, serverConfig: RestServerResolvedConfig, name?: string);
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

request


</td><td>

Request


</td><td>


</td></tr>
<tr><td>

response


</td><td>

Response


</td><td>


</td></tr>
<tr><td>

parent


</td><td>

[Context](./context.context.md)


</td><td>


</td></tr>
<tr><td>

serverConfig


</td><td>

[RestServerResolvedConfig](./rest.restserverresolvedconfig.md)


</td><td>


</td></tr>
<tr><td>

name


</td><td>

string


</td><td>

_(Optional)_


</td></tr>
</tbody></table>

