client

package
v0.0.6 Latest Latest
Warning

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

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

Documentation

Overview

* @Author: your name * @Date: 2021-03-24 11:32:44 * @LastEditTime: 2021-06-23 11:29:31 * @LastEditors: Please set LastEditors * @Description: In User Settings Edit * @FilePath: \socloud-servere:\wuhuarou\renlanglang\zzsd\tools\pkg\client\client.go

Index

Constants

View Source
const (
	ContentType = "Content-Type"
	ContentJson = "application/json"
	ContentFrom = "application/x-www-form-urlencoded;charset=utf-8"
	User_Agent  = "" /* 127-byte string literal not displayed */
	Accept      = "text/html, application/xhtml+xml, image/jxr, */*"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(ctx context.Context, opts ...OptionClient) (client *Client)

func (*Client) Delete

func (client *Client) Delete(ctx context.Context, requestURL string) (*http.Response, error)

func (*Client) Get

func (client *Client) Get(ctx context.Context, requestURL string) (*http.Response, error)

func (*Client) Post

func (client *Client) Post(ctx context.Context, requestURL string, requestBody interface{}) (*http.Response, error)

func (*Client) PostForm

func (Client *Client) PostForm(ctx context.Context, requestURL string, requestBody string) (*http.Response, error)

func (*Client) Put

func (client *Client) Put(ctx context.Context, requestURL string, requestBody interface{}) (*http.Response, error)

type HttpClient

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

type OptionClient

type OptionClient interface {
	Apply(*HttpClient)
}

func WithHTTPClient

func WithHTTPClient(client *http.Client) OptionClient

func WithTimeOut

func WithTimeOut(timeout time.Duration) OptionClient

Jump to

Keyboard shortcuts

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