request

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2019 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

Package request 提供Tigo框架自带的http client功能,此包包含发送http请求的方法。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpClient

type HttpClient struct {
	*http.Client
}

HttpClient 是自定义HTTPClient

type Response

type Response struct {
	*http.Response
	Content []byte
}

Response 自定义Http的Response

func Delete

func Delete(requestUrl string, headers ...map[string]string) (*Response, error)

Delete 向指定url发送delete请求

func Get

func Get(requestUrl string, headers ...map[string]string) (*Response, error)

Get 向指定url发送get请求

func Head(requestUrl string, headers ...map[string]string) (*Response, error)

Head 向指定url发送head请求

func Options

func Options(requestUrl string, headers ...map[string]string) (*Response, error)

Options 向指定url发送options请求

func Patch

func Patch(requestUrl string, postParams map[string]interface{}, headers ...map[string]string) (*Response, error)

Patch 向指定url发送patch请求

func Post

func Post(requestUrl string, postParams map[string]interface{}, headers ...map[string]string) (*Response, error)

Post 向指定url发送post请求

func Put

func Put(requestUrl string, postParams map[string]interface{}, headers ...map[string]string) (*Response, error)

Put 向指定url发送put请求

func Request

func Request(method string, requestUrl string, postParams map[string]interface{}, headers ...map[string]string) (*Response, error)

Request 发送指定的Request请求

func (*Response) ToContentStr

func (response *Response) ToContentStr() string

ToContentStr 将Response实例的Content转换为字符串

Jump to

Keyboard shortcuts

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