# RestClient API

REST API client abstraction for JSON-oriented HTTP calls.

---
Canonical: /handbook/api/interfaces/_purista_core.RestClient/
Source: HttpClient/types/RestClient.ts
Format: Markdown for agents
---

REST API client abstraction for JSON-oriented HTTP calls.

Package: `@purista/core`

## Signature

```typescript
interface RestClient
```

## Members

### Methods

- `delete<T>(path: string, options: HttpClientRequestOptions): Promise<T>` — Make a DELETE request against baseUrl+path
Returns body text if response content type is not set to `application/json`.
If response content type is `application/json`, the JSON parsed result will be returned
- `get<T>(path: string, options: HttpClientRequestOptions): Promise<T>` — Make a GET request against baseUrl+path
Returns body text if response content type is not set to `application/json`.
If response content type is `application/json`, the JSON parsed result will be returned
- `patch<T>(path: string, payload: unknown, options: HttpClientRequestOptions): Promise<T>` — Make a PATCH request against baseUrl+path
Returns body text if response content type is not set to `application/json`.
If response content type is `application/json`, the JSON parsed result will be returned
- `post<T>(path: string, payload: unknown, options: HttpClientRequestOptions): Promise<T>` — Make a POST request against baseUrl+path
Returns body text if response content type is not set to `application/json`.
If response content type is `application/json`, the JSON parsed result will be returned
- `put<T>(path: string, payload: unknown, options: HttpClientRequestOptions): Promise<T>` — Make a PUT request against baseUrl+path
Returns body text if response content type is not set to `application/json`.
If response content type is `application/json`, the JSON parsed result will be returned
- `setBearerToken(token: string | undefined): void` — Set the Auth-Bearer-Token for all following requests
