httptools

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostFileRequest

func NewPostFileRequest(url, formName, fileName, path string) (req *http.Request, err error)

NewPostFileRequest 创建一个文件上传请求 模拟<form ...><input name="file" type="file" />...</form> 参数说明 url: 上传服务器URL formName: 对应<input>标签中的name fileName: 为form表单中的文件名 path: 为实际要上传的本地文件路径

func PostFile

func PostFile(cli *http.Client, url, formName, fileName, path string) (res *http.Response, err error)

PostFile 通过HTTP上传文件

func ProxyClient

func ProxyClient(opt config.ProxyConfig) *http.Client

func ProxyClientSocks5

func ProxyClientSocks5(opt config.ProxyConfig) *http.Client

func ProxyConfigFromSetting

func ProxyConfigFromSetting(group, key string) (*config.ProxyConfig, error)

ProxyConfigFromSetting get proxy config from settings

func ProxySocks5FromSetting

func ProxySocks5FromSetting(cli *http.Client, group, key string) error

ProxySocks5 set proxy for http client

func TransformContentType2Ext

func TransformContentType2Ext(hdr http.Header) string

TransformContentType2Ext

func TransformExt2ContentType

func TransformExt2ContentType(ext string) string

TransformExt2ContentType

Types

This section is empty.

Jump to

Keyboard shortcuts

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