http

package
v0.0.0-...-df740be Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package http http tools Author: Frank Lee Date: 2017-11-17 09:16:30 Last Modified by: Frank Lee Last Modified time: 2017-11-17 09:16:30

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(url string) ([]byte, error)

Get get param url: url return []byte: http response body return error: errors

func GetInTime

func GetInTime(url string, time *time.Duration) ([]byte, error)

GetInTime get timeout param url: url param time: timeout return []byte: http response body return error: errors

func GetInsecure

func GetInsecure(url string) ([]byte, error)

GetInsecure https get insecurely with timeout param url: url return []byte: response body return error: errors

func GetInsecureInTime

func GetInsecureInTime(url string, time *time.Duration) ([]byte, error)

GetInsecureInTime https get insecurely with timeout param url: url param time: timeout return []byte: response body return error: errors

func Post

func Post(url, params string, t ContentType) ([]byte, error)

Post post param url: url param params: params param t: content-type http.JSON/http.FORM return []byte: http response body return error: errors

func PostInTime

func PostInTime(url, params string, t ContentType, time *time.Duration) ([]byte, error)

PostInTime post timeout param url: url param params: params param t content-type http.JSON/http.FORM param time timeout return []byte: http response body return error: errors

func PostInsecure

func PostInsecure(url, params string, t ContentType) ([]byte, error)

PostInsecure https post insecurely with timeout param url: url param params: params param t content-type http.JSON/http.FORM return []byte: http response body return error: errors

func PostInsecureInTime

func PostInsecureInTime(url, params string, t ContentType, time *time.Duration) ([]byte, error)

PostInsecureInTime https post insecurely with timeout param url: url param params: params param t content-type http.JSON/http.FORM param time: timeout return []byte: http response body return error: errors

Types

type ContentType

type ContentType int

ContentType content-type

const (

	// JSON application/json
	JSON ContentType = 0

	// FORM application/x-www-form-urlencoded
	FORM ContentType = 1
)

Jump to

Keyboard shortcuts

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