Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 835 Bytes

README.md

File metadata and controls

26 lines (17 loc) · 835 Bytes

Bash HTTP Client

CLI HTTP "client" and a bash HTTP "library" for sending HTTP requests.

This is a basic HTTP client. Codes 200, 301 and 302 redirection and all 4XX and 5XX error codes are supported. SSL is not supported. Only text file download is supported.

Requirements

  1. bash, 3 or later

Installation

Git clone or copy paste bashclient.sh

Example usage

You can use bashclient as a library and source it inside your script, or as a CLI tool with arguments.

$ ./bashclient.sh -u http://google.com
$ ./bashclient.sh -s google.com -p /#q=bashclient.sh+github
$ ./bashclient.sh -u http://freegeoip.net/json > response.json

When sourcing inside script call get_http function with URL as a argument or set SERVER and URLPATH variables inside your script. URLPATH must be set with a leading /.