# @actions/http-client

> Actions Http Client

Latest version **4.0.1** (published 2026-04-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @actions/http-client
pnpm add @actions/http-client
yarn add @actions/http-client
bun add @actions/http-client
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2026-04-21 |
| First published | 2020-01-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 74.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 5858 |
| Maintainers | bryanmacfarlane, thboop, ericsciple, bdehamer |
| Keywords | github, actions, http |

## Links

- npm: https://www.npmjs.com/package/@actions/http-client
- Repository: https://github.com/actions/toolkit
- Homepage: https://github.com/actions/toolkit/tree/main/packages/http-client
- Issues: https://github.com/actions/toolkit/issues
- npm.io page: https://npm.io/package/@actions/http-client

## Dependencies (2)

- [tunnel](https://npm.io/package/tunnel.md) ^0.0.6
- [undici](https://npm.io/package/undici.md) ^6.23.0

## Recent versions

- 4.0.1 (latest) — 2026-04-21
- 4.0.0 — 2026-01-28
- 3.0.2 — 2026-01-27
- 3.0.1 — 2026-01-07
- 3.0.0 — 2025-10-31
- 2.2.3 — 2024-08-22
- 2.2.2 — 2024-08-16
- 2.2.1 — 2024-03-04
- 2.2.0 — 2023-10-06
- 2.1.1 — 2023-08-04
- 2.1.0 — 2023-03-06
- 2.0.1 — 2022-05-13
- 2.0.0 — 2022-05-10
- 1.0.11 — 2021-03-25
- 1.0.10 — 2021-03-24
- … 10 more at https://npm.io/package/@actions/http-client/versions

## README

# `@actions/http-client`

A lightweight HTTP client optimized for building actions.

## Features

  - HTTP client with TypeScript generics and async/await/Promises
  - Typings included!
  - [Proxy support](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-self-hosted-runners#using-a-proxy-server-with-self-hosted-runners) just works with actions and the runner
  - Targets ES2019 (runner runs actions with node 24+).  Only supported on node 20+.
  - Basic, Bearer and PAT Support out of the box.  Extensible handlers for others.
  - Redirects supported

Features and releases [here](./RELEASES.md)

## Install

```
npm install @actions/http-client --save
```

## Samples

See the [tests](./__tests__) for detailed examples.

## Errors

### HTTP

The HTTP client does not throw unless truly exceptional.

* A request that successfully executes resulting in a 404, 500 etc... will return a response object with a status code and a body.
* Redirects (3xx) will be followed by default.

See the [tests](./__tests__) for detailed examples.

## Debugging

To enable detailed console logging of all HTTP requests and responses, set the NODE_DEBUG environment varible:

```shell
export NODE_DEBUG=http
```

## Node support

The http-client is built using Node 24. It may work on previous node LTS versions but it's tested and officially supported on Node 20+.

## Support and Versioning

We follow semver and will hold compatibility between major versions and increment the minor version with new features and capabilities (while holding compat).

## Contributing

We welcome PRs.  Please create an issue and if applicable, a design before proceeding with code.

once:

```
npm install
```

To build:

```
npm run build
```

To run all tests:

```
npm test
```

---
_Source: https://npm.io/package/@actions/http-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
