requests

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Author: Daniel TAN Date: 2021-10-02 01:05:20 LastEditors: Daniel TAN LastEditTime: 2021-10-02 01:06:29 FilePath: /trinity-micro/core/requests/interface.go Description:

Author: Daniel TAN Date: 2021-09-03 12:24:12 LastEditors: Daniel TAN LastEditTime: 2021-09-28 01:11:13 FilePath: /pmpm_reporting_api/Users/danieltan/Workspace/trinity-micro/core/requests/mime.go Description:

Author: Daniel TAN Date: 2021-09-03 12:24:12 LastEditors: Daniel TAN LastEditTime: 2021-10-22 01:11:57 FilePath: /trinity-micro/core/requests/requests.go Description:

Index

Constants

View Source
const (
	HeaderMime          = "Content-Type"
	HeaderDate          = "Date"
	HeaderAuthorization = "Authorization"
	HeaderXPhumacAlgo   = "X-Phumac-Algo"
	HeaderKeyContentMD5 = "Content-MD5"
)
View Source
const (
	MimeJson     = "application/json"
	MimeTextXML  = "text/xml"
	MimeTextHTML = "text/html"
	MimeXML      = "application/xml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpRequest added in v0.1.2

type HttpRequest struct {
}

func (*HttpRequest) Call added in v0.1.2

func (r *HttpRequest) Call(ctx context.Context, method string, url string, header http.Header, body interface{}, dest interface{}, requestInterceptors ...Interceptor) error

Call will return the err when the response code is not >=200 or <= 300 will decode the response to dest even it return error

type Interceptor

type Interceptor func(r *http.Request) error

type Requests added in v0.1.2

type Requests interface {
	Call(ctx context.Context, method string, url string, header http.Header, body interface{}, dest interface{}, requestInterceptors ...Interceptor) error
}

func NewRequest added in v0.1.3

func NewRequest() Requests

Jump to

Keyboard shortcuts

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