---
sidebar_position: 5
title: Guide - Headers
sidebar_label: Headers
---

# Headers

---

### Request Headers

We can set the headers in two ways - when creating the request, or dynamically through `.setHeaders(` method.

---

### Example

```ts
const getUsers = client.createRequest()({
  endpoint: "/users",
  headers: {
    "Content-Type": "application/json",
  },
});
console.log(getUsers.headers); // Output: { "Content-Type": "application/json" }
```

```ts
const request = createUser.setHeaders({
  "Content-Type": "application/json",
});
console.log(request.headers); // Output: { "Content-Type": "application/json" }
```

#### Directly on send method

```ts
const response = getUser.send({
  headers: {
    "Content-Type": "application/json",
  },
});
```
