httx is a simple, fast, lightweight and user-friendly API client. Whether you are working with a CLI, a library or a server, httx is a perfect choice for making HTTP requests.
- π API Requests: make API requests
- π€ CLI: a cross-platform CLI
- π Library: use httx as a library in your project
- β‘ Fast: extremely fast and efficient
- πͺΆ Lightweight: built on web standards, lightweight & without dependencies
- πΆ User-Friendly: user-friendly, simple, powerful API
- πͺπ½ Type-Safe: strongly-typed, including type-safe errors
bun install -d @stacksjs/httx
Note
We are trying to release under the httx
package name, which is currently abandoned. Please @npmjs, we would love to!ππ½
Making requests is simple. There are two ways of getting started: as a library or as a CLI.
Given the npm package is installed:
import type { HttxConfig } from 'httx'
// import { ... } from 'httx'
// ...
In case you are trying to start multiple proxies, you may use this configuration:
httx get api.example.com/users
httx post api.example.com/users name=john email=john@example.com -j
httx get api.example.com/files file@./data.txt -m
httx get api.example.com/secure -a username:password
httx --help
httx --version
The Reverse Proxy can be configured using a httx.config.ts
(or httx.config.js
) file and it will be automatically loaded when running the reverse-proxy
command.
// httx.config.{ts,js}
import type { HttxOptions } from '@stacksjs/httx'
import os from 'node:os'
import path from 'node:path'
const config: HttxOptions = {
verbose: false,
}
export default config
Then run:
./httx
To learn more, head over to the documentation.
bun test
Please see our releases page for more information on what has changed recently.
Please review the Contributing Guide for details.
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
For casual chit-chat with others using this package:
Join the Stacks Discord Server
Two things are true: Stacks OSS will always stay open-source, and we do love to receive postcards from wherever Stacks is used! We also publish them on our website.
Our address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094 π
We would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.
The MIT License (MIT). Please see LICENSE for more information.
Made with π