1.1.1 • Published 4 years ago

h2c v1.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

h2c

Node.js CI Known Vulnerabilities

A basic HTTP/2 command-line client for making web requests with Node.js. HTTP/1.1 and earlier are not supported.

Installation

Install globally to be able to use the h2c command from anywhere.

$ npm install h2c --global

Usage

Providing an absolute URI as the only argument will submit a GET request.

$ h2c http://localhost:3000/hello

The response headers and response body are then printed to stdout.

 HTTP/2  200 OK
content-type: text/plain; charset=UTF-8
content-length: 13
date: Wed, 03 Jun 2020 07:00:40 GMT

Hello, world!

Options

-m, --method

Set the request method. Defaults to GET.

$ h2c -m HEAD http://localhost:3000/

-h, --header

Set a request header. Can be used multiple times to add multiple headers.

$ h2c -h 'accept: application/json' -h 'accept-language: en-US,en;q=0.5' http://localhost:3000/

d, --data

Add data to the request body. Only applies to POST, PUT, and PATCH requests.

$ h2c -m POST -d '{"foo":42}' -h 'content-type: application/json' http://localhost:3000/
1.1.1

4 years ago

1.1.0

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago