MCPcopy Index your code
hub / github.com/go-dev-frame/sponge / push

Method push

pkg/httpcli/httpcli.go:225–240  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

223}
224
225func (req *Request) push() (*Response, error) {
226 var buf *bytes.Buffer
227
228 if req.bodyJSON != nil {
229 body, err := json.Marshal(req.bodyJSON)
230 if err != nil {
231 req.err = err
232 return nil, req.err
233 }
234 buf = bytes.NewBuffer(body)
235 } else {
236 buf = bytes.NewBufferString(req.body)
237 }
238
239 return req.send(buf, buf)
240}
241
242func (req *Request) send(body io.Reader, buf *bytes.Buffer) (*Response, error) {
243 req.request, req.err = http.NewRequest(req.method, req.url, body)

Callers 15

POSTMethod · 0.95
PUTMethod · 0.95
PATCHMethod · 0.95
DoMethod · 0.95
TestErrorFunction · 0.80
vFunction · 0.80
WFunction · 0.80
atFunction · 0.80
listenMethod · 0.80
addMethod · 0.80
CeFunction · 0.80
$eFunction · 0.80

Calls 2

sendMethod · 0.95
MarshalMethod · 0.65

Tested by 1

TestErrorFunction · 0.64