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

Method SetHeader

client/client.go:432–438  ·  view source on GitHub ↗

SetHeader sets a single header field and its value in the client.

(key, val string)

Source from the content-addressed store, hash-verified

430
431// SetHeader sets a single header field and its value in the client.
432func (c *Client) SetHeader(key, val string) *Client {
433 c.mu.Lock()
434 defer c.mu.Unlock()
435
436 c.header.Set(key, val)
437 return c
438}
439
440// AddHeaders adds multiple header fields and their values to the client.
441func (c *Client) AddHeaders(h map[string][]string) *Client {

Calls 3

LockMethod · 0.65
UnlockMethod · 0.65
SetMethod · 0.65

Tested by 8

Test_Client_HeaderFunction · 0.36
Test_ReplaceFunction · 0.36
Test_Request_HeaderFunction · 0.36
BenchmarkRequestHeapScanFunction · 0.36