# @nova-lang/http

> Nova HTTP client library — fetch, request helpers, URL utilities, and API client patterns

Latest version **0.1.0** (published 2026-06-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @nova-lang/http
pnpm add @nova-lang/http
yarn add @nova-lang/http
bun add @nova-lang/http
```

## Health

**Score 45/100 (D)** — status: active.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2026-06-30 |
| First published | 2026-06-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | wuyuchentr |
| Keywords | nova, http, fetch, api, rest, client |

## Links

- npm: https://www.npmjs.com/package/@nova-lang/http
- Repository: https://github.com/nova-lang/http
- Homepage: https://github.com/nova-lang/http#readme
- Issues: https://github.com/nova-lang/http/issues
- npm.io page: https://npm.io/package/@nova-lang/http

## Recent versions

- 0.1.0 (latest) — 2026-06-30

## README

# @nova-lang/http

Nova HTTP client library — fetch-based request helpers, URL utilities, status code helpers, and auth patterns.

## Install

```sh
npm install @nova-lang/http
```

## Usage

```nova
@use "nova/http"
```

### Requests

| Function | Description |
|----------|-------------|
| `http-get(url, opts)` | GET request |
| `http-get-json(url, opts)` | GET and parse JSON response |
| `http-get-text(url, opts)` | GET and return text |
| `http-get-buffer(url, opts)` | GET and return ArrayBuffer |
| `http-post(url, body, opts)` | POST request |
| `http-post-json(url, data, opts)` | POST with JSON body |
| `http-post-form(url, data, opts)` | POST with form-encoded body |
| `http-put(url, body, opts)` | PUT request |
| `http-put-json(url, data, opts)` | PUT with JSON body |
| `http-patch(url, body, opts)` | PATCH request |
| `http-patch-json(url, data, opts)` | PATCH with JSON body |
| `http-delete(url, opts)` | DELETE request |
| `http-delete-json(url, opts)` | DELETE and parse JSON response |
| `http-request(url, opts)` | Raw request with full options |
| `http-fetch(url, opts)` | Direct fetch wrapper |

### Status Codes

| Function | Description |
|----------|-------------|
| `http-ok(status)` | Check if 2xx |
| `http-redirect(status)` | Check if 3xx |
| `http-client-error(status)` | Check if 4xx |
| `http-server-error(status)` | Check if 5xx |
| `http-status-text(status)` | Get human-readable status text |

### Headers

| Function | Description |
|----------|-------------|
| `http-headers(obj)` | Create Headers object |
| `http-header-get(headers, name)` | Get header value |
| `http-header-set(headers, name, value)` | Set header |
| `http-header-has(headers, name)` | Check header exists |
| `http-header-delete(headers, name)` | Delete header |

### URL Utilities

| Function | Description |
|----------|-------------|
| `http-url-parse(url)` | Parse URL into object |
| `http-url-encode(str)` | Encode URL component |
| `http-url-decode(str)` | Decode URL component |
| `http-url-params(obj)` | Create URLSearchParams |
| `http-url-params-string(obj)` | Encode params as string |
| `http-url-join(base, path)` | Join URL paths |
| `http-url-query(url, params)` | Add query params to URL |

### Content Type Detection

| Function | Description |
|----------|-------------|
| `http-is-json(headers)` | Check if response is JSON |
| `http-is-form(headers)` | Check if response is form |
| `http-is-html(headers)` | Check if response is HTML |

### Auth

| Function | Description |
|----------|-------------|
| `http-basic-auth(username, password)` | Basic auth header value |
| `http-bearer-auth(token)` | Bearer auth header value |
| `http-auth-header(scheme, credentials)` | Custom auth header |

## License

MIT

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