xhttp

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpMethod

type HttpMethod string

HttpMethod - defines the HttpMethod type.

const (
	// Get - Defines the GET HttpMethod.
	Get HttpMethod = "GET"
	// Post - Defines the POST HttpMethod.
	Post = "POST"
)

type HttpResponse

type HttpResponse struct {
	Body        []byte
	Headers     map[string][]string
	LatencyInMs int64
	Status      int
}

HttpResponse - contains information about the http response.

func Call

func Call(ctx context.Context, url string, method HttpMethod, headers map[string]string, body string) (*HttpResponse, error)

Call - retrieves the body from the given URL.

Jump to

Keyboard shortcuts

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