com_http

package
v0.0.0-...-3d4fdec Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package com_http provide function about http standard library

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultHeader = map[string]string{
		"Accept": "application/json",
	}
)

Functions

func Get

func Get(ctx context.Context, url string, header map[string]string, result any) error

Get get method. return json data

func Post

func Post(ctx context.Context, url string, header map[string]string, data []byte, result any) error

Post post method. return json data

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(proxyUrl string) (*Client, error)

New get client

func (*Client) Get

func (c *Client) Get(ctx context.Context, url string, header map[string]string, result any) error

Get get method. return json data

func (*Client) Post

func (c *Client) Post(ctx context.Context, url string, header map[string]string, data []byte, result any) error

Post post method. return json data

Jump to

Keyboard shortcuts

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