httpUtils

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: MIT Imports: 8 Imported by: 0

README

Kushuh go http utils

Post

Send a post request from go, in application/json format.

// payload is a map[string]interface{}
res, err := httpUtils.Post(url, payload)

PostForm

Send a post request from go, with a form content.

files := []httpUtils.File{
    {
        Path: '/path/to/my/file',
        Key: 'file'
    }
}

// payload is a map[string]interface{}
res, err := httpUtils.PostForm(url, payload, files)

2020 Kushuh - MIT license

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Post

func Post(u string, d map[string]interface{}) (*http.Response, error)

func PostForm

func PostForm(u string, d map[string]string, f []File) (*http.Response, error)

Types

type File

type File struct {
	Path string
	Key  string
}

Jump to

Keyboard shortcuts

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