Documentation ¶
Index ¶
- func NewPostFileRequest(url, formName, fileName, path string) (req *http.Request, err error)
- func PostFile(cli *http.Client, url, formName, fileName, path string) (res *http.Response, err error)
- func ProxyClient(opt config.ProxyConfig) *http.Client
- func ProxyClientSocks5(opt config.ProxyConfig) *http.Client
- func ProxyConfigFromSetting(group, key string) (*config.ProxyConfig, error)
- func ProxySocks5FromSetting(cli *http.Client, group, key string) error
- func TransformContentType2Ext(hdr http.Header) string
- func TransformExt2ContentType(ext string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPostFileRequest ¶
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 ¶
ProxySocks5 set proxy for http client
func TransformContentType2Ext ¶
TransformContentType2Ext
func TransformExt2ContentType ¶
TransformExt2ContentType
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.