requests

package
v2.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthKeyHeader added in v2.7.0

func AuthKeyHeader(key *rsa.PublicKey) map[string][]string

AuthKeyHeader is a header prototype including an encoded RSA PublicKey

func JSONHeaders added in v2.7.0

func JSONHeaders() map[string][]string

JSONHeaders is a header prototype for JSON based requests

func MergeHeaders added in v2.7.0

func MergeHeaders(headers ...map[string][]string) map[string][]string

MergeHeaders merges two or more header prototypes together from left to right

Example
left := map[string][]string{"A": {"Value Of A"}}
right := map[string][]string{"B": {"Value Of B"}}

merged := MergeHeaders(left, right)
fmt.Println(merged["A"])
fmt.Println(merged["B"])
Output:

[Value Of A]
[Value Of B]

Types

type SignedRequest

type SignedRequest struct {
	Key        *rsa.PrivateKey
	HTTPMethod string
	BaseURL    string
	Endpoint   string
	Headers    map[string][]string
	Params     map[string]string
	Body       []byte
	Error      error
}

SignedRequest is a builder for constructing a http.Request with Yoti signing

func (SignedRequest) Request

func (msg SignedRequest) Request() (request *http.Request, err error)

Request builds a http.Request with signature headers

func (SignedRequest) WithPemFile

func (msg SignedRequest) WithPemFile(in []byte) SignedRequest

WithPemFile loads the private key from a PEM file reader

Jump to

Keyboard shortcuts

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