MCPcopy Create free account
hub / github.com/BryanMwangi/pine / NewClient

Function NewClient

client.go:46–53  ·  view source on GitHub ↗

Call this to create a new client You can then call SetRequestURI, SetMethod, SetHeaders, and SetBody after creating the client

()

Source from the content-addressed store, hash-verified

44// You can then call SetRequestURI, SetMethod, SetHeaders, and SetBody
45// after creating the client
46func NewClient() *Client {
47 return &Client{
48 Client: http.DefaultClient,
49 req: &Request{
50 jsonEncoder: json.Marshal,
51 },
52 }
53}
54
55// NewClientWithTimeout returns a new client with a timeout
56func NewClientWithTimeout(timeout time.Duration) *Client {

Callers 11

mainFunction · 0.92
TestNewClientFunction · 0.85
TestRequest_JSONFunction · 0.85
TestRequest_SetHeadersFunction · 0.85
TestRequest_SetMethodFunction · 0.85
TestClient_SendRequestFunction · 0.85
TestClient_ReadResponseFunction · 0.85

Calls

no outgoing calls

Tested by 10

TestNewClientFunction · 0.68
TestRequest_JSONFunction · 0.68
TestRequest_SetHeadersFunction · 0.68
TestRequest_SetMethodFunction · 0.68
TestClient_SendRequestFunction · 0.68
TestClient_ReadResponseFunction · 0.68