request_listener

package
v4.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurlLogDumper

func CurlLogDumper(request *http.Request)

CurlLogDumper will log the request using the curl command format /!\ Caution request header and Body can be heavy !!

Following example will log curl command if request has header "dump" not empty Eg tripperware: tripperware.Skip(

func(request *http.Request) bool {
   return request.Header.Get("dump") != ""
},
tripperware.RequestListener(request_listener.CurlLogDumper),

)

Eg middleware: middleware.Skip(

func(request *http.Request) bool {
   return request.Header.Get("dump") != ""
},
middleware.RequestListener(request_listener.CurlLogDumper),

)

Types

type Cmd

type Cmd []string

func GetCurlCommand

func GetCurlCommand(req *http.Request) (*Cmd, error)

func (*Cmd) String

func (c *Cmd) String() string

Jump to

Keyboard shortcuts

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