# @dynatrace-sdk/http-client

@dynatrace-sdk/http-client

## 1.5.2

### Patch Changes

- Published packages now include an `exports` map in their `package.json` (with `types`, `require` and `import` conditions), so Node.js resolves the `esm/` output as native ES modules. Previously the `module` field was only honoured by bundlers, so the `type: module` marker in `esm/package.json` had no effect in plain Node.js ESM resolution. Deep imports into `cjs/`, `esm/` or `types/` that are not listed in the map are no longer permitted.
- A `package.json` containing `{"type":"module"}` is now emitted into the `esm/` output directory of each published package. This allows Node.js and bundlers to correctly identify the ESM output as ES modules without requiring the `.mjs` file extension.
- Updated dependencies 

- Updated dependencies 

  - @dynatrace-sdk/error-handlers@1.3.3

## 1.5.1

### Patch Changes

- Make `data` constructor argument optional in `HttpClientResponse` and `HttpClientResponseError`, falling back to `response.url` when `requestUrl` is not provided. Restores backward compatibility broken in v1.5.0. (APPDEV-17720)

## 1.5.0

### Minor Changes

- Add `requestUrl` to `HttpClientResponse` so the originally requested URL is preserved (and surfaced in error logs) even when `fetch` follows a redirect. (APPDEV-16083)

### Patch Changes

- Generated TypeScript declarations are now rolled up into a single `types/index.d.ts` per entry point. (APPDEV-11700)

## 1.4.0

### Minor Changes

- Add safety margin token expiration time. (APPDEV-11345)

## 1.3.1

### Patch Changes

- Fix JSDoc annotations.
- The errorCode field in serialized error details is now set using proper errorCode from response instead of status code.

## 1.3.0

### Minor Changes

- Added support for native AbortSignal, existing implementation marked as deprecated. APPDEV-8680

## 1.2.1

### Patch Changes

- Fix multipart/form-data deserialization in Safari. APPDEV-8496

## 1.2.0

### Minor Changes

- Allow configuring the base URL of the http-client. APPDEV-8174
- Allow setting the default headers for the http-client. APPDEV-8175

## 1.1.1

### Patch Changes

- Rename `OAuthHttpClient` to `_OAuthHttpClient` to mark it for internal use only.

## 1.1.0

### Minor Changes

- Add `OAuthHttpClient`

## 1.0.10

### Patch Changes

- Fix sending files in a non-browser environment.

## 1.0.9

### Patch Changes

- Expose typeguards for http-client errors.
- Allow to read http-client`s body multiple times.
- Additional `details` field in `httpClientResponseErrorSerializer`.

## 1.0.8

### Patch Changes

- Add optional `traceId` to `SerializedError`.
- Updated dependencies 

  - @dynatrace-sdk/error-handlers@1.2.0

## 1.0.7

### Patch Changes

- Update docs

## 1.0.6

### Patch Changes

- Update package description

## 1.0.5

### Patch Changes

- Add response status and response source to DataTypeError.

## 1.0.4

### Patch Changes

- Content-Type header value is now present in the response body type error message.
- HttpResponseError serializer is not failing because of response body type error anymore.

## 1.0.3

### Patch Changes

- Add optional `errorRef` to `SerializedError`
- Updated dependencies 

  - @dynatrace-sdk/error-handlers@1.1.0

## 1.0.2

### Patch Changes

- Add message of original error to HttpClientRequestError.

## 1.0.1

### Patch Changes

- Parse response body in global error serializer

## 1.0.0

### Major Changes

- Initial public release.