Giter Site home page Giter Site logo

httpy's Introduction


httpy

httpy: Modern, user-friendly, programmable command-line HTTP client for the API

httpy is a command line HTTP client. Its purpose is to make duplicate web requests on a single line. httpy is designed for testing, debugging, and generally interacting with APIs and HTTP servers. The httpy command allows creating and sending arbitrary HTTP requests. They use simple and natural syntax and provide formatted and colored output. Under favour of its programmable structure, it can perform many tasks at the same time. For example, you can pull data for user IDs 0, 1, and 2 at the same time

Codacy Badge Latest version Twitter

httpy in action

Getting started

Installation instructions

pip install httpy-cli

Features

  • Expressive and intuitive syntax

  • Formatted and colorized terminal output

  • Programmable requests

    • Multiple requests one line

    • Value incremented each time

    • Random number per request

    • Read each value from the lines in the file

    • Value per each request as a list of multiple values

  • Built-in JSON support

  • Arbitrary request data

  • Custom headers

Structures

$ httpy <URL> <METHOD> <HEADERS,QUERIES,DATA> --exec <COMMAND>

Custom method, headers, queries and JSON data:

$ httpy httpbin.org/put PUT HeaderName:HeaderValue data=value query==value

Command

$ httpy httpbin.org/get --exec <KEY>:<OPERATION>:<MAX_RUN>

Examples

Basic Request:

$ httpy httpbin.org/get

Usage custom method, headers, queries and JSON data:

$ httpy httpbin.org/put PUT HeaderName:HeaderValue data=value query==value

Custom HTTP method, HTTP headers and JSON data:

$ httpy httpbin.org/post POST X-API-Token:123 name=John

Run 3 times:

$ httpy httpbin.org/get --exec i:++:3

Pass a value to URL:

$ httpy 'httpbin.org/get?value={i}' --exec i:VALUE

Pass a value to the URL by running it 2 times:

$ httpy 'httpbin.org/get?value={i}' --exec i:VALUE:2

Get 0, 1, 2, 3, 4, 5 post one line and just show body:

$ httpy https://jsonplaceholder.typicode.com/posts/{i} --exec i:++:6 -B

Pass a value to the Header and just show status:

$ httpy httpbin.org/get Authorization:{i} --exec i:token1, token2, token3 -S

Operation List

Operation Description
++ Increment
-- Deincrement
rand(0,10) Random number from 1 to 10
read(path/to/file) Read from file
item1, item2 List
item Text

Community & support

Contributing

Have a look through existing Issues and Pull Requests that you could help with. If you'd like to request a feature or report a bug, please create a GitHub Issue using one of the templates provided.

Sinan Kanidağlı © 2022

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.