gohttpex

package
v1.0.17 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientIp

func GetClientIp(r *http.Request) string

GetClientIp returns the client ip of this request without port. Note that this ip address might be modified by client header.

func HttpGet

func HttpGet[T any](url string, params string, headers map[string]string, t *T, retryCount int) (*T, error)

func HttpGetValues

func HttpGetValues[T any](url string, params url.Values, headers map[string]string, t *T, retryCount int) (*T, error)

func HttpGetValuesResultBody

func HttpGetValuesResultBody(url string, params url.Values, headers map[string]string, retryCount int) ([]byte, error)

func HttpPost

func HttpPost[T any](url string, params map[string]interface{}, headers map[string]string, t *T) (*T, error)

func HttpPostJson

func HttpPostJson[T any](url string, params string, headers map[string]string, timeout int, t *T) (*T, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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