httpmultipart

package module
v0.0.0-...-3c1edc0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: MIT Imports: 7 Imported by: 0

README

httpmultipart

Go client that sends HTTP with multipart content

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PostRequest

func PostRequest(address string, params Params) (*http.Response, error)

PostRequest send a request based on method, address and params

Types

type Params

type Params struct {
	// contains filtered or unexported fields
}

Params hold information about how to add multipart content to HTTP client

func InitParams

func InitParams() Params

InitParams initialize Params struct

func (*Params) AddReadFile

func (p *Params) AddReadFile(name, filename string) (bool, error)

AddReadFile read a content of a file and set it content as a parameter. If something went wrong, an error is returned.

func (*Params) AddString

func (p *Params) AddString(name, value string) (bool, error)

AddString add/change a string parameter to the Params struct If name already exists it will override existed parameter.

Jump to

Keyboard shortcuts

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