Giter Club home page Giter Club logo

mcurl's Introduction

mcurl

Installation

go install -v github.com/ninjawule/mcurl

Top

How to use - help

mcurl -h

Top

Example

Command

mcurl -v -X POST --url https://example.com -H Content-Type:application/json -H Authorization:Bearer\ xMLdsjhryq67snqa089FX -r 3 \{\"key\":\"value\"\} -n 5

Explanation :

  • we're activating the verbose mode with -v
  • we're requesting with HTTP method POST
  • working with url https://example.com
  • setting 2 header parameters with -H used twice here
  • launching 5 identical requests in parallel with -n 5
  • sending data with -d (or from a file with flag -i)
  • doing all this 3 times, for better average times computation, with -r 3

Top

Output

2020/11/05 09:31:04 -----------------------------------------------------------------------------------------------
2020/11/05 09:31:04 --- STARTING the testing of 5 'parallel' requests @ https://example.com (3 times)
2020/11/05 09:31:04 -----------------------------------------------------------------------------------------------
2020/11/05 09:31:04 Running options =
method  : POST
url     : https://example.com
nbReqs  : 5
repeat  : 3
data    : {"key":"value"}
headers : Content-Type: application/json, Authorization: Bearer K0i79im-QAmeRe9wASjzpA
2020/11/05 09:31:04 --- Doing try n°1
2020/11/05 09:31:04 Starting request 5
2020/11/05 09:31:04 Starting request 2
2020/11/05 09:31:04 Starting request 3
2020/11/05 09:31:04 Starting request 1
2020/11/05 09:31:04 Starting request 4
2020/11/05 09:31:04 Request 1 done in 504.988041ms
2020/11/05 09:31:04 Request 5 done in 505.236564ms
2020/11/05 09:31:04 Request 3 done in 505.31119ms
2020/11/05 09:31:04 Request 2 done in 505.933135ms
2020/11/05 09:31:04 Request 4 done in 506.504041ms
2020/11/05 09:31:04 --- --> Done in 506.704702ms. Average / Max request time: 505.594594ms / 506.504041ms
2020/11/05 09:31:05 --- Doing try n°2
2020/11/05 09:31:05 Starting request 5
2020/11/05 09:31:05 Starting request 2
2020/11/05 09:31:05 Starting request 3
2020/11/05 09:31:05 Starting request 1
2020/11/05 09:31:05 Starting request 4
2020/11/05 09:31:06 Request 5 done in 149.238699ms
2020/11/05 09:31:06 Request 1 done in 149.201297ms
2020/11/05 09:31:06 Request 2 done in 149.523666ms
2020/11/05 09:31:06 Request 4 done in 150.656459ms
2020/11/05 09:31:06 Request 3 done in 151.896139ms
2020/11/05 09:31:06 --- --> Done in 152.061727ms. Average / Max request time: 150.103252ms / 151.896139ms
2020/11/05 09:31:07 --- Doing try n°3
2020/11/05 09:31:07 Starting request 5
2020/11/05 09:31:07 Starting request 2
2020/11/05 09:31:07 Starting request 3
2020/11/05 09:31:07 Starting request 1
2020/11/05 09:31:07 Starting request 4
2020/11/05 09:31:07 Request 5 done in 142.497641ms
2020/11/05 09:31:07 Request 3 done in 143.873313ms
2020/11/05 09:31:07 Request 1 done in 143.868609ms
2020/11/05 09:31:07 Request 2 done in 144.226347ms
2020/11/05 09:31:07 Request 4 done in 144.551647ms
2020/11/05 09:31:07 --- --> Done in 144.74459ms. Average / Max request time: 143.803511ms / 144.551647ms
2020/11/05 09:31:08 -----------------------------------------------------------------------------------------------
2020/11/05 09:31:08 --- Done in 3.812915071s. Average / Max request time: 266.500452ms / 506.504041ms
2020/11/05 09:31:08 -----------------------------------------------------------------------------------------------

Top

TODO

  • being able to change the body for each request

Top

mcurl's People

Contributors

wuleninja avatar

Watchers

 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.