http

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	SendRequest(ctx context.Context, logger logr.Logger, method string, url string, body []byte, headers map[string][]string) (resp Response, err error)
}

Client is the interface to interact with HTTP

func NewClient

func NewClient(hClient http.Client) Client

NewClient returns a new HTTP Client.

type Request

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

Request represents an HTTP request.

type Response

type Response struct {
	Body       string
	Headers    map[string][]string
	StatusCode int
}

Response represents an HTTP response.

Jump to

Keyboard shortcuts

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