MCPcopy Index your code
hub / github.com/imroc/req / SetCommonHeaderOrder

Method SetCommonHeaderOrder

client.go:931–942  ·  view source on GitHub ↗

SetCommonHeaderOrder set the order of the http header requests fired from the client (case-insensitive). For example: client.R().SetCommonHeaderOrder( "custom-header", "cookie", "user-agent", "accept-encoding", ).Get(url

(keys ...string)

Source from the content-addressed store, hash-verified

929// "accept-encoding",
930// ).Get(url
931func (c *Client) SetCommonHeaderOrder(keys ...string) *Client {
932 c.Transport.WrapRoundTripFunc(func(rt http.RoundTripper) HttpRoundTripFunc {
933 return func(req *http.Request) (resp *http.Response, err error) {
934 if req.Header == nil {
935 req.Header = make(http.Header)
936 }
937 req.Header[HeaderOderKey] = keys
938 return rt.RoundTrip(req)
939 }
940 })
941 return c
942}
943
944// SetCommonPseudoHeaderOder set the order of the pseudo http header requests fired
945// from the client (case-insensitive).

Callers 4

ImpersonateChromeMethod · 0.80
ImpersonateFirefoxMethod · 0.80
ImpersonateSafariMethod · 0.80
SetCommonHeaderOrderFunction · 0.80

Calls 2

RoundTripMethod · 0.65
WrapRoundTripFuncMethod · 0.45

Tested by

no test coverage detected