httpx

package
v0.0.0-...-bcfd2cf Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DELETE

func DELETE(url string, headers map[string]string) (string, error)

DELETE request wrapper

func GET

func GET(url string, headers map[string]string) (string, error)

GET request wrapper

func PATCH

func PATCH(url string, obj interface{}, headers map[string]string) (string, error)

PATCH request wrapper

func POST

func POST(url string, obj interface{}, headers map[string]string) (string, error)

POST request wrapper

func PUT

func PUT(url string, obj interface{}, headers map[string]string) (string, error)

PUT request wrapper

func ParseResponse

func ParseResponse(res *http.Response) (string, error)

func RequestIP

func RequestIP(c echo.Context) (ip string, err error)

RequestIP check different request's locations and returns the origin IP

Types

type Error

type Error struct {
	Status bool   `json:"status,omitempty"`
	Code   int    `json:"code,omitempty"`
	Type   string `json:"type,omitempty"`
}

Error response body

Jump to

Keyboard shortcuts

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