Skip to content

norsasaki/test_http_request

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

test_http_request | simple GET method test tool for http request

This is tool for testing http request like status code, response time, response header, html page content etc.

DEMO

python3 test_http_request.py
  http_code    time_total  content-type              x-cache                                                                                        x-check-cacheable    m#<title>(.+)</title>#
-----------  ------------  ------------------------  ---------------------------------------------------------------------------------------------  -------------------  --------------------------------------
        200      0.145372  text/html; charset=utf-8  N/A                                                                                            N/A                  GitHub: Let’s build from here · GitHub
        200      0.408339  text/html; charset=utf-8  N/A                                                                                            N/A                  Features • GitHub Actions · GitHub
        200      1.8198    text/html;charset=UTF-8   TCP_MISS from a23-194-201-20.deploy.akamaitechnologies.com (AkamaiGHost/10.10.3-45298580) (-)  NO                   Akamai Community

Features

  • test URLs listed in uri_list.txt
  • multiprocess execution
  • HTTP requests are generated by curl command (options for curl command are available)
  • response header, curl write-out option, html content can be inspected
  • Supports Mac/Windows

Requirement

  • Python 3.10.8 or higher
  • Python modules
    • requests
    • yaml
    • tabulate
    • dictknife

Installation

pip3 install requests tabulate dictknife
git clone [email protected]:norsasaki/test_http_request.git
cd test_http_request
python3 test_http_request.py

Usage

  • Define the http request header and cookie to be added to the http request in test_http_request.yaml.
  • Define the items to be tested in the result section of test_http_request.yaml.
  • curl option can be specified directly in cmd of test_http_request.yaml
cmd: curl -sS -k 
proto: https
domain: github.com
user-agent: Mozilla/5.0 (test_http_request)
header:
  - [Pragma, "akamai-x-cache-on,akamai-x-check-cacheable"]
cookie: 
  - [login-token, xxxx]
  - [AWSALBCORS, xxxx]
result:
  - http_code
  - time_total
  - content-type
  - x-cache
  - x-check-cacheable
  - m#<title>(.+)</title>#

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages