Skip to content
/ httx Public

πŸ€– A modern command-line & library HTTP client, "for the API era." Like httpie, written in & for TypeScript.

License

Notifications You must be signed in to change notification settings

stacksjs/httx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

33 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Social Card of this repo

npm version GitHub Actions Commitizen friendly

httx

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.

Screenshot of httx

Features

  • 🌐 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

Install

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!πŸ™πŸ½

Get Started

Making requests is simple. There are two ways of getting started: as a library or as a CLI.

Library

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:

CLI

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

Configuration

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.

Testing

bun test

Changelog

Please see our releases page for more information on what has changed recently.

Contributing

Please review the Contributing Guide for details.

Community

For help, discussion about best practices, or any other conversation that would benefit from being searchable:

Discussions on GitHub

For casual chit-chat with others using this package:

Join the Stacks Discord Server

Postcardware

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 🌎

Sponsors

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.

Credits

License

The MIT License (MIT). Please see LICENSE for more information.

Made with πŸ’™

About

πŸ€– A modern command-line & library HTTP client, "for the API era." Like httpie, written in & for TypeScript.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks