npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

http-requester

v0.13.22

Published

Perform HTTP & WS requests like a boss! A command line utility that supports HTTP, HTTPS, Websocket and server creation, featuring a cool interactive shell. Ideal for testing and debugging.

Downloads

107

Readme

HTTP Requester

Perform HTTP & WS requests like a boss!

A command line utility that supports HTTP, HTTPS, Websocket and server creation.

It features a cool interactive shell.

Ideal for testing and debugging.

  • License: MIT
  • Current status: beta

Install

Do not forget to install it globally:

npm install -g http-requester

Feature highlights:

  • HTTP, HTTPS and Websocket requests
  • Dummy HTTP and Websocket server creation
  • A cool interactive shell with history and auto-completion (even headers)
  • An interactive Websocket Chatter

“Like a boss? Screenshot please!”

Screenshot

Available command line options:

  • Without any argument, it runs the interactive shell
  • --help, -h: display help
  • --shell: run requests in an interactive shell, like a boss!
  • --method : set the HTTP method
  • --protocol http|https|ws: set the protocol, 'http', 'https' or 'ws'
  • --host : set the targeted host
  • --port , -p : set the targeted port, default is 80 (HTTP) or 443 (HTTPS)
  • --path : set the path of the targeted resource in the host
  • --url : the full URL of the resource, will be splitted into protocol, host, port and path
  • --headers.* : any header can be specified as an option, e.g. --headers.content-type application/json. If it is not conflicting with another options, it can be used without prefix, like --content-type application/json
  • --headers : specify all headers using the JSON format
  • --auth ":": basic authentication i.e. "user:password" to compute an Authorization header
  • --timeout : set the request timeout in ms
  • --output , -o : if given, the body's response will be written to this file instead of STDOUT
  • --http: shortcut for --protocol http
  • --https: shortcut for --protocol https
  • --ws: shortcut for --protocol ws
  • --beautify, -b: beautify JSON body
  • --server: start a server
  • --config : a JSON file containing all the above options, structured in an object

Syntactic sugar:

  • http-requester launch the interactive shell, like http-requester --shell
  • http-requester <file> load a config file, like http-requester --config <file>
  • http-requester <url> GET the url, like http-requester --method get --url <url>
  • http-requester <method> <url> request the url, like http-requester --method <method> --url <url>

Available interactive shell commands:

  • show or s

    List the details of the request about to be performed.

  • request or req

    Perform the request.

  • <protocol>://<host>[:<port>][/<path>]

    Parse the full URL and set the protocol, host, port and path.

    E.g.: > http://localhost:8080/blog/index.html

  • host <hostname>[:<port>]

    Set the host and port to connect to.

    E.g.: > host localhost:8080

  • port <port>

    Set the port to connect to.

  • protocol http|https|ws

    Set the protocol to use.

  • method <HTTP method>

    Set the HTTP method.

  • cd <path>

    Modify the path just like the shell 'cd' command does. Start the path with a '/' to set the absolute path, otherwise it moves relative to the current path. It does NOT modify the query-string part of the URL.

    E.g.: > cd blog , > cd .. , > cd ../../blog/index.html , > cd /index.html , ...

  • ? <query string>

    Set the query string part of the URL. Use a single ? alone to erase the query string.

    E.g.: > ? , > ?key=value , > ?key1=value1&key2=value2 , ...

  • headers.<header> <value>

    Set a HTTP header.

    E.g.: > headers.Content-type: text/html

  • <header>: <value>

    The shortest way to set a HTTP header.

    E.g.: > Content-type: text/html

  • auth <user>:<password>

    Basic authentication to compute an Authorization header.

  • body <body string>

    Set the body of the request.

  • body

    Set the body of the request, using the multi-line mode.

  • timeout <ms>

    Set the request timeout in ms.

  • clear [headers|auth|body]

    Clear headers, auth or body, without argument: clear both.

  • autoclear [headers|auth|body]

    Autoclear headers, auth or body after each request, without argument: just check.

  • autocookie

    Turn autocookie on/off.

  • beautify

    Turn beautify on/off for JSON body.

  • ls

    List all known sub-resources of the current path, just like the UNIX 'ls' command does.