Git Product home page Git Product logo

bash-headers's Introduction

Bash Headers

A CLI HTTP Headers Filtering Tool (written in Bash)

Note: before this I had built a Go version called "carbon"

Install

Either source this script within your .bashrc or copy/paste it directly

Usage

Set endpoint and filter out specific HTTP response headers:

$ headers http://www.integralist.co.uk/ 'x-cache|x-timer'

HTTP/1.1 200 OK

X-Cache-Hits: 1
X-Cache: HIT
X-Timer: S1488622963.657342,VS0,VE0

Set endpoint but default to showing all the available HTTP response headers (sorted alphabetically):

$ headers http://www.integralist.co.uk/

HTTP/1.1 200 OK

Access-Control-Allow-Origin: *
Age: 9
Cache-Control: max-age=600
Connection: keep-alive
Content-Length: 8165
Content-Type: text/html; charset=utf-8
Date: Sat, 04 Mar 2017 10:21:37 GMT
Expires: Sat, 04 Mar 2017 10:31:28 GMT
Fastly-Debug-Digest: 8e24d54087128488953c21c63c67485d543224e740f857d4e799563fb18db6fa
Fastly-Debug-Path: (D cache-lcy1120-LCY 1488622897) (F cache-lcy1137-LCY 1488622888)
Fastly-Debug-TTL: (H cache-lcy1120-LCY - - 9)
HTTP/1.1 200 OK
Last-Modified: Fri, 03 Mar 2017 08:33:36 GMT
Server: GitHub.com
Surrogate-Key: www_integralist_co_uk
Vary: Accept-Encoding
Via: 1.1 varnish
X-Cache-Hits: 1
X-Cache: HIT
X-Fastly-Request-ID: f44a92925b0203579bb51431f431ad056177a6d8
X-GitHub-Request-Id: 6564:04D4:2D3D0E:3D7C1C:58BA9525
X-Served-By: cache-lcy1120-LCY
X-Timer: S1488622897.811340,VS0,VE0

No parameters will display general usage examples:

$ headers

        Examples:
                headers https://www.buzzfeed.com/?country=us 'x-cache|x-timer|device' '-H User-Agent:iphone'
                headers https://www.buzzfeed.com/?country=us '' '-H User-Agent:iphone -H X-Foo:bar'

        Help:   headers -h
                headers -help

Help flag (-h or -help):

$ headers -h

        1st param: URL
        2nd param: regex
        3rd param: http request header

        if you have no need for a regex
        but need a http header
        then just use an empty string ''

bash-headers's People

Contributors

integralist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.