Movatterモバイル変換


[0]ホーム

URL:


httputil

package
v0.1.0Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2025 License:Apache-2.0Imports:15Imported by:6

Details

Repository

github.com/no-src/nsgo

Links

Documentation

Index

Constants

View Source
const (// HeaderContentType the Content-Type http headerHeaderContentType = "Content-Type")

Variables

This section is empty.

Functions

funcNewTLSConfig

func NewTLSConfig(insecureSkipVerifybool, certFilestring) (*tls.Config,error)

NewTLSConfig create a tls config

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

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp