Skip to content

Instantly share code, notes, and snippets.

View khfayzullaev's full-sized avatar

Khurshid Fayzullaev khfayzullaev

View GitHub Profile
@khfayzullaev
khfayzullaev / http.sh
Created September 15, 2017 04:37
A basic CURL wrapper for shell scripts (inspired by https://gist.github.com/maxcnunes/9f77afdc32df354883df)
#!/bin/bash
http() {
# HTTP verb, url, and payload
URL=${1-""}
VERB=${2-"GET"}
PAYLOAD=${3-"{}"}
# store the whole response with the status at the and
HTTP_RESPONSE=$(curl --connect-timeout 3 --max-time 5 --silent \