curl

package
v0.0.0-...-d8850a5 Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

curl

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpBuildQuery

func HttpBuildQuery(params map[string]string) string

HttpBuildQuery 格式化url会按照字母进行排序

Types

type Request

type Request struct {
	Url         string
	Method      string
	Headers     map[string]string
	BodyData    interface{}
	ReqTimeOut  time.Duration
	RespTimeOut time.Duration
}

Request 请求数据

type Response

type Response struct {
	Status     string
	StatusCode int
	Header     map[string]string
	Body       []byte
}

Response 响应数据

func Curl

func Curl(req Request) (resp Response, err error)

Curl 请求

func Get

func Get(req Request) (resp Response, err error)

Get HTTP GET 请求

func Post

func Post(req Request) (resp Response, err error)

POST HTTP POST 请求

Jump to

Keyboard shortcuts

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