httputil
package v0.1.0
Go to latest Published: Jul 2, 2025 License:Apache-2.0
Opens a new window with list of versions in this module.
Latest LatestThis package is not in the latest version of its module.
Opens a new window with license information.
Imports:15 Opens a new window with list of imports.
Imported by:6 Opens a new window with list of known importers.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
Constants¶
View Source
const (// HeaderContentType the Content-Type http headerHeaderContentType = "Content-Type")Variables¶
This section is empty.
Functions¶
Types¶
typeHttpClient¶
type HttpClient interface {// HttpGet get http resourceHttpGet(urlstring) (resp *http.Response, errerror)// HttpGetWithCookie get http resource with cookiesHttpGetWithCookie(urlstring, headerhttp.Header, cookies ...*http.Cookie) (resp *http.Response, errerror)// HttpPost send a post request with form dataHttpPost(urlstring, dataurl.Values) (resp *http.Response, errerror)// HttpPostWithCookie send a post request with form data and cookiesHttpPostWithCookie(urlstring, dataurl.Values, cookies ...*http.Cookie) (resp *http.Response, errerror)// HttpPostFileChunkWithCookie send a post request with form data, a file chunk and cookiesHttpPostFileChunkWithCookie(urlstring, fieldNamestring, fileNamestring, dataurl.Values, chunk []byte, cookies ...*http.Cookie) (resp *http.Response, errerror)// HttpPostWithoutRedirect send a post request with form data and not auto redirectHttpPostWithoutRedirect(urlstring, dataurl.Values) (resp *http.Response, errerror)// Download if the local file does not exist and the alwaysDownload is false, downloads the remote file to local pathDownload(path, urlstring, alwaysDownloadbool)error// HttpPostData send a post request with dataHttpPostData(urlstring, data []byte) (resp *http.Response, errerror)// HttpPut send a put request with dataHttpPut(urlstring, data []byte) (resp *http.Response, errerror)// HttpDelete send a delete request with dataHttpDelete(urlstring, data []byte) (resp *http.Response, errerror)}HttpClient an HTTP client component that supports chunked file uploads using the POST method
funcNewHttpClient¶
func NewHttpClient(insecureSkipVerifybool, certFilestring, enableHTTP3bool) (HttpClient,error)
NewHttpClient create a http client
Click to show internal directories.
Click to hide internal directories.