Giter VIP home page Giter VIP logo

curl-for-performance-engineers's Introduction

cURL for Performance Engineers

Examples

In WSL: curl --version

In Windows PowerShell:

curl -version will fail. Type curl.exe --version for valid output.

curl https://example.com

curl -v https://example.com

curl --trace output https://example.com

curl --trace - --trace-time example.com

curl --trace-ascii ascii_output https://example.com

Globbing

curl https://reqres.in/api/users/\[1-10\]

curl https://reqres.in/api/users/\{1,10,111,5\}

Storing Output

curl https://reqres.in/api/users/\{1,10,111,5\} -o "output_#1"

ls

output_1 output_10 output_111 output_5

Progress Bar

curl https://reqres.in/api/users/\{1,10,111,5\} -o "output_#1" -#

Redirects

curl http://example.com/ > example.html

curl example.com --next example.net

Follow Redirects

curl google.com -L

Proxy

curl -x localhost:8080 http://example.com/

curl --proxy localhost:8080 http://example.com/

POST

curl -X POST -d '{"name":"morpheus","job":"leader"}' https://reqres.in/api/users

Multipart Form

curl -F custname=tester \
 -F custtel=1234 \
 -F custemail=test%40test.com \
 -F size=small \
 -F topping=bacon \
 -F delivery=15%3A00 \
 -F comments=knock+the+door \
 http://httpbin.org/post

Cookies

Save

curl -c cookies.txt http://example.com

Load

curl -b cookies.txt https://www.google.com

Basic Auth

curl --user client321:test123 https://zigzag-selective-boysenberry.glitch.me

Performance Measurements

curl -w "Request Done \n" http://example.com/

curl -w @output.txt http://example.com

curl -w "HTTP Version: %{http_version}\nCode: %{response_code}\nTotal Time: %{time_total} \n" --head http://example.com

curl -w @timings.txt --head http://bing.com

timings.txt

url: %{url}\n
code: %{response_code}\n
number of bytes: %{size_download}\n
average download speed: %{speed_download}\n
average download speed: %{speed_upload}\n
redirect_url : %{redirect_url}\n

time_namelookup:  %{time_namelookup}s\n
time_connect:  %{time_connect}s\n
time_appconnect:  %{time_appconnect}s\n
time_pretransfer:  %{time_pretransfer}s\n
time_redirect:  %{time_redirect}s\n
time_starttransfer:  %{time_starttransfer}s\n

time_total:  %{time_total}s\n

curl-for-performance-engineers's People

Contributors

qainsights 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.