internal

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteRequest

func DeleteRequest(name string) bool

func GetBodyFromUser

func GetBodyFromUser(method string) string

GetBodyFromUser prompts the user to enter a request body if required

func GetHeadersFromUser

func GetHeadersFromUser() map[string]string

GetHeadersFromUser prompts the user to enter headers interactively

func ListRequests

func ListRequests()

ListRequests prints all saved API requests

func ParseHeaders

func ParseHeaders(headersStr string) map[string]string

ParseHeaders converts a JSON string into a `map[string]string`

func SaveRequest

func SaveRequest(name, url, method string, headers map[string]string, body string)

func SendRequest

func SendRequest(url, method string, headers map[string]string, body []byte)

SendRequest makes an HTTP request and prints the response

Types

type APIRequest

type APIRequest struct {
	URL     string            `json:"url"`
	Method  string            `json:"method"`
	Headers map[string]string `json:"headers"`
	Body    string            `json:"body"`
}

func LoadRequest

func LoadRequest(name string) (APIRequest, bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL