httputil

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	XKtbsPlatformName  = "X-Ktbs-Platform-Name"
	XKtbsApiVersion    = "X-Ktbs-Api-Version"
	XKtbsSignature     = "X-Ktbs-Signature"
	XKtbsRequestID     = "X-Ktbs-Request-ID"
	XKtbsClientName    = "X-Ktbs-Client-Name"
	XKtbsClientVersion = "X-Ktbs-Client-Version"
	XKtbsTime          = "X-Ktbs-Time"
)

Variables

This section is empty.

Functions

func ExcludeSensitiveHeader

func ExcludeSensitiveHeader(header http.Header, excludedString []string) (h http.Header)

ExcludeSensitiveHeader exclude sensitive header. Currently, sensitive header only Authorization

func ExcludeSensitiveRequestBody

func ExcludeSensitiveRequestBody(body *string)

func IsClientError

func IsClientError(code int) bool

func IsRedirection

func IsRedirection(code int) bool

func IsServerError

func IsServerError(code int) bool

func IsSuccess

func IsSuccess(code int) bool

func KitabisaHeader

func KitabisaHeader(req *http.Request, clientName, clientVersion, requestID string) *http.Request

func ReadRequestBody

func ReadRequestBody(req *http.Request) (bodyString string)

func SetAuth

func SetAuth(req *http.Request, jwt string)

SetAuth must be called after SetKitabisaHeader if request require auth

func SetKitabisaHeader

func SetKitabisaHeader(ctx context.Context, clientName, clientVersion string, req *http.Request)

func SetSignature

func SetSignature(req *http.Request, secretKey string)

SetSignature must be called after SetKitabisaHeader if request require signature

Types

This section is empty.

Jump to

Keyboard shortcuts

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