Documentation
¶
Index ¶
- func Head(targetURL string, Header ...map[string]string) (*http.Response, error)
- type DownloadResponse
- type FileItem
- type HTTPFile
- func (h *HTTPFile) Download(targetURL string, savePath string, Header ...map[string]string) (*DownloadResponse, error)
- func (h *HTTPFile) Head(targetURL string, Header ...map[string]string) (*http.Response, error)
- func (h *HTTPFile) Upload(opts UploadOptions) (*UploadResponse, error)
- func (h *HTTPFile) UploadFile(filePath string, targetURL string, Header ...map[string]string) (*UploadResponse, error)
- func (h *HTTPFile) UploadReader(body io.Reader, targetURL string, Header ...map[string]string) (*UploadResponse, error)
- type UploadOptions
- type UploadResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DownloadResponse ¶
type DownloadResponse struct { Res *http.Response FileSize int64 Header http.Header StatusCode int }
DownloadResponse ...
type FileItem ¶
FileItem ...
func NewFileItem ¶
NewFileItem ...
func NewFileItems ¶
NewFileItems ...
type HTTPFile ¶
type HTTPFile struct {
// contains filtered or unexported fields
}
HTTPFile ...
func (*HTTPFile) Download ¶
func (h *HTTPFile) Download(targetURL string, savePath string, Header ...map[string]string) (*DownloadResponse, error)
Download will get filename from 'Content-Disposition' if savePath is empty.
func (*HTTPFile) Upload ¶
func (h *HTTPFile) Upload(opts UploadOptions) (*UploadResponse, error)
Upload ...
func (*HTTPFile) UploadFile ¶
func (h *HTTPFile) UploadFile(filePath string, targetURL string, Header ...map[string]string) (*UploadResponse, error)
UploadFile ...
func (*HTTPFile) UploadReader ¶
func (h *HTTPFile) UploadReader(body io.Reader, targetURL string, Header ...map[string]string) (*UploadResponse, error)
UploadReader ...
type UploadOptions ¶
type UploadOptions struct { FileItems []FileItem TargetURL string Header map[string]string // file by default FileField string ExtraField map[string]string Stream bool }
UploadOptions ...
type UploadResponse ¶
UploadResponse ...
func Upload ¶
func Upload(opts UploadOptions) (*UploadResponse, error)
Upload single or multi file to file server by formdata
func UploadFile ¶
func UploadFile(filePath string, targetURL string, Header ...map[string]string) (*UploadResponse, error)
UploadFile ...
func UploadReader ¶
func UploadReader(body io.Reader, targetURL string, Header ...map[string]string) (*UploadResponse, error)
UploadReader ...
Click to show internal directories.
Click to hide internal directories.