http

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(link string, header map[string]string, params map[string]string) ([]byte, error)

Get 请求

link 请求地址 http://www.baidu.com

header 请求头

params 请求参数

func PostFile added in v1.0.6

func PostFile(link string, params map[string]string, filename string, path string) ([]byte, error)

PostFiles 上传单个文件

link 上传URL地址

params 上传的表单参数

filename 上传文件的参数名,比如 file

path 上传文件路径,如: /home/123.wav

func PostFiles added in v1.0.6

func PostFiles(link string, params map[string]string, files map[string]string) ([]byte, error)

PostFiles post表单上传文件

params 表单参数

files [文件参数名]文件存放路径

func PostForm added in v1.0.6

func PostForm(link string, values map[string]string) ([]byte, error)

PostForm post请求提交表单

link 请求URL

values 表单参数

func PostJSON

func PostJSON(link string, body string) ([]byte, error)

PostJSON post请求提交JSON数据

link 请求地址 http://www.baidu.com

body 提交的json数据

Types

This section is empty.

Jump to

Keyboard shortcuts

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