Categorygithub.com/Cod3ddy/http-client-cli
modulepackage
0.0.0-20240806211031-a1d6023de222
Repository: https://github.com/cod3ddy/http-client-cli.git
Documentation: pkg.go.dev

# README

HTTP Client CLI

HTTP Client CLI is a command line interface application written in Go. It allows you to perform simple HTTP requests using the Cobra-CLI library.

Getting Started

To run the application, use the go run command followed by the main.go file and the specific command you want to execute. For example:

go run main.go router post --url "http://localhost:4000/example/login" --data "{}"

Supported Commands

Currently, the application supports the following commands:

  • post: Sends a POST request to the specified URL with the provided data.
  • get: Sends a GET request to the specified URL.

POST Request

To send a POST request, use the post command followed by the --url flag to specify the URL and the --data flag to provide the data. The data should be in JSON format. For example:

go run main.go router post --url "http://localhost:4000/example/login" --data "{username: jondoe, password:123doe}"

You can also provide the data by dragging and dropping a JSON file onto the terminal or typing in the path to a .json file. For example:

go run main.go router post --data C:\User\example\Desktop\cred.json --url "http://localhost:4000/example/login"

GET Request

To send a GET request, use the get command followed by the --url flag to specify the URL. For example:

go run main.go router get --url "http://localhost:4000/example/login"

Future Improvements

The following features are planned for future releases:

  • Support for all HTTP methods with additional parameters like headers.
  • Implementation of DELETE request.
  • Ability to send UPDATE request.

# Packages

Copyright © 2024 NAME HERE <EMAIL ADDRESS> */.
No description provided by the author