shttp

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectFileType

func DetectFileType(file *os.File) (string, error)

DetectFileType returns the MIME type of given file by reading the file header of the file that is located on disk.

func Upload

func Upload(client *http.Client, url string, values map[string]io.Reader, header map[string]string) (*http.Response, error)

Upload takes an url and multiple reader, that are used to fill in a multipart form.

Heavily inspired by: https://stackoverflow.com/a/20397167/11155150 but with the standard http package, there are not many other ways to do that, so it doesn't really matter.

Types

This section is empty.

Jump to

Keyboard shortcuts

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