http

package
v2.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package http handles interactions over HTTP

Index

Constants

View Source
const (
	// BodyParameterMode is a configuration flag specifying the value passed via
	// HTTP should be through the HTTP body parameter
	BodyParameterMode = "body"
	// QueryParameterMode is a configuration flag specifying the value passed
	// via HTTP should be through the HTTP query parameter
	QueryParameterMode = "query"
)
View Source
const (
	// QueryParameterKey is the key of the query parameter passed if the query
	// parameter mode is used, in the form https://example.com?value="DATA"
	QueryParameterKey = "value"
)
View Source
const Type = "http"

Type http represents an HTTP request

Variables

This section is empty.

Functions

This section is empty.

Types

type Execute

type Execute struct {
	ClientGenerator func(tlsConfig *tls.Config) (*gohttp.Client, error)
	ReadFile        func(filename string) ([]byte, error)
}

Execute represents a way to execute HTTP requests with values as parameters.

func DefaultExecute added in v2.6.0

func DefaultExecute() *Execute

DefaultExecute creates an HTTP executer with a default Go HTTP client generator and readfile utility

func (*Execute) ExecuteWithValue

func (e *Execute) ExecuteWithValue(method *config.Method, value string) (string, error)

ExecuteWithValue executes an HTTP request with the value provided as parameter, configurable to be either in the body or query string

func (*Execute) GetType

func (e *Execute) GetType() string

GetType returns the http executer type

Jump to

Keyboard shortcuts

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