From fc23364cf0716ffc0f3da6b072dd57d0a9ea1f5d Mon Sep 17 00:00:00 2001 From: Dave Cheney Date: Wed, 11 Dec 2024 11:45:19 +1100 Subject: [PATCH] Update the README for this project --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/davecheney/httpstat?shareId=XXXX-XXXX-XXXX-XXXX). --- README.md | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/README.md b/README.md index 00c5edd..18696ac 100644 --- a/README.md +++ b/README.md @@ -6,16 +6,56 @@ Imitation is the sincerest form of flattery. But seriously, https://github.com/reorx/httpstat is the new hotness, and this is a shameless rip off. +## Table of Contents +- [Installation](#installation) +- [Usage](#usage) +- [Features](#features) +- [Examples](#examples) +- [Use Cases](#use-cases) +- [Running Tests](#running-tests) +- [Building the Project](#building-the-project) +- [CI/CD with GitHub Actions](#cicd-with-github-actions) +- [Contributing](#contributing) + ## Installation `httpstat` requires Go 1.20 or later. ``` go install github.com/davecheney/httpstat@latest ``` +### Detailed Installation Instructions + +#### Windows +1. Download and install Go from the official website: https://golang.org/dl/ +2. Open Command Prompt and run the following command: + ``` + go install github.com/davecheney/httpstat@latest + ``` + +#### macOS +1. Download and install Go from the official website: https://golang.org/dl/ +2. Open Terminal and run the following command: + ``` + go install github.com/davecheney/httpstat@latest + ``` + +#### Linux +1. Download and install Go from the official website: https://golang.org/dl/ +2. Open Terminal and run the following command: + ``` + go install github.com/davecheney/httpstat@latest + ``` + +### Troubleshooting Installation Issues +- Ensure that Go is installed correctly by running `go version` in your terminal or command prompt. +- Make sure your `GOPATH` and `GOROOT` environment variables are set correctly. +- If you encounter any issues, refer to the official Go installation guide: https://golang.org/doc/install + ## Usage ``` httpstat https://example.com/ ``` + ## Features - Windows/BSD/Linux supported. @@ -29,6 +69,54 @@ httpstat https://example.com/ - HTTP/HTTPS proxies supported via the usual `HTTP_PROXY`/`HTTPS_PROXY` env vars (as well as lower case variants). - Supply your own client side certificate with `-E cert.pem`. +## Examples + +### Basic Usage +``` +httpstat https://example.com/ +``` + +### Using Custom HTTP Method +``` +httpstat -X POST https://example.com/ +``` + +### Providing a Request Body +``` +httpstat -X POST -d "key=value" https://example.com/ +``` + +### Adding Extra Request Headers +``` +httpstat -H "Authorization: Bearer " https://example.com/ +``` + +## Use Cases + +### Measuring Response Time +Use `httpstat` to measure the response time of your web application and identify performance bottlenecks. + +### Debugging HTTP Requests +`httpstat` can help you debug HTTP requests by providing detailed timing information for each phase of the request. + +### Monitoring API Performance +Monitor the performance of your APIs by regularly running `httpstat` and tracking the response times. + +## Running Tests +To run tests, use the following command: +``` +go test -race ./... +``` + +## Building the Project +To build the project using the provided `Makefile`, use the following command: +``` +make +``` + +## CI/CD with GitHub Actions +This project uses GitHub Actions for CI/CD. The workflow is defined in the `.github/workflows/push.yml` file. It runs tests, performs static analysis, and verifies the Go modules. + ## Contributing Bug reports are most welcome, but with the exception of #5, this project is closed.