MCPcopy
hub / github.com/gofiber/fiber / newClient

Function newClient

client/client.go:957–981  ·  view source on GitHub ↗
(transport httpClientTransport)

Source from the content-addressed store, hash-verified

955}
956
957func newClient(transport httpClientTransport) *Client {
958 return &Client{
959 transport: transport,
960 header: &Header{
961 RequestHeader: &fasthttp.RequestHeader{},
962 },
963 params: &QueryParam{
964 Args: fasthttp.AcquireArgs(),
965 },
966 cookies: &Cookie{},
967 path: &PathParam{},
968
969 userRequestHooks: []RequestHook{},
970 builtinRequestHooks: []RequestHook{parserRequestURL, parserRequestHeader, parserRequestBody},
971 userResponseHooks: []ResponseHook{},
972 builtinResponseHooks: []ResponseHook{parserResponseCookie, logger},
973 jsonMarshal: json.Marshal,
974 jsonUnmarshal: json.Unmarshal,
975 xmlMarshal: xml.Marshal,
976 cborMarshal: cbor.Marshal,
977 cborUnmarshal: cbor.Unmarshal,
978 xmlUnmarshal: xml.Unmarshal,
979 logger: log.DefaultLogger[*log.Logger](),
980 }
981}
982
983// C returns the default client.
984func C() *Client {

Callers 3

NewWithClientFunction · 0.85
NewWithHostClientFunction · 0.85
NewWithLBClientFunction · 0.85

Calls 1

DefaultLoggerFunction · 0.92

Tested by

no test coverage detected