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

Method pull

pkg/httpcli/httpcli.go:199–223  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

197}
198
199func (req *Request) pull() (*Response, error) {
200 val := ""
201 if len(req.params) > 0 {
202 values := url.Values{}
203 for k, v := range req.params {
204 values.Add(k, fmt.Sprintf("%v", v))
205 }
206 val += values.Encode()
207 }
208
209 if val != "" {
210 if strings.Contains(req.url, "?") {
211 req.url += "&" + val
212 } else {
213 req.url += "?" + val
214 }
215 }
216
217 var buf *bytes.Buffer
218 if req.customRequest != nil {
219 buf = bytes.NewBufferString(val)
220 }
221
222 return req.send(nil, buf)
223}
224
225func (req *Request) push() (*Response, error) {
226 var buf *bytes.Buffer

Callers 4

GETMethod · 0.95
DELETEMethod · 0.95
DoMethod · 0.95
TestErrorFunction · 0.80

Calls 2

sendMethod · 0.95
AddMethod · 0.65

Tested by 1

TestErrorFunction · 0.64