New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

loh

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loh

http request on cli with ease

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

loh

Make http request on cli with ease

Installation

Use package managers:

npm install -g loh # npm
yarn global add loh # yarn

Usage

Fetch request

You can do a fetch request using axios with ease

$ loh fetch --url https://example.com

Re-run command with options

You can easily rerun previous commands, such as fetch without re-inputting the options

$ loh rerun 
# This will run the previous command in the background without having you to retype them

You can also see the list of available commands using the loh help command.

Options

Repeat & delay

You can easily do a same fetch request multiple times with the option to set a delay for each request

$ loh fetch -u https://example.com --repeat 10 # Do a fetch request 11 times (repeat the same fetch 10 times)
$ loh fetch -u https://example.com --repeat 10 -wait 2000 # Do a total of 11 fetch request with 2000 milliseconds of delay each

Set Headers

Set a JSON header

$ loh fetch -u https://example.com --headers '{"Authorization":"123456"}' --method POST

Set body

Set the request body as text or JSON

$ loh fetch -u https://example.com --body '{"value":"hello"}' --method POST

Set User Agent

Set the user agent (Note: a random user agent will be generated and used automatically)

$ loh fetch -u https://example.com --useragent loh

Set Output & format data

Set a file to save output data

$ loh fetch -u https://example.com --output ./output.txt
$ loh fetch -u https://example.com --output ./output.txt  --type 'status|data|timings'

Example output data of the second line:

200
This is a response body
[{"timingEnd":1666711647530,"timingStart":1666711647117,"elapsedTime":413}]

Proxy

Use a proxy server

Use proxy server to do a request

$ loh fetch --url https://example.com -p
Set a proxy server
$ loh proxy '{"proxy":{"host":"proxy-url","port":80,"auth":{"username":"my-user","password":"my-password"}}'
Remove proxy
$ loh proxy --remove

Relay

loh supports relay-server

Use relay in a request

$ loh fetch -u https://example.com --relay
Set relay
$ loh relay --url https://proxy.example.com
Delete relay
$ loh relay --url https://proxy.example.com --remove
View the list of relays
$ loh relay

Contributors

License

This project is available as open source under the terms of the AGPL-3.0 License

FAQs

Package last updated on 26 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc