MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / createRequest

Function createRequest

dgraph/cmd/alpha/http_test.go:268–279  ·  view source on GitHub ↗
(method, contentType, url string, body string)

Source from the content-addressed store, hash-verified

266}
267
268func createRequest(method, contentType, url string, body string) (*http.Request, error) {
269 req, err := http.NewRequest(method, url, bytes.NewBufferString(body))
270 if err != nil {
271 return nil, err
272 }
273
274 if contentType != "" {
275 req.Header.Set("Content-Type", contentType)
276 }
277
278 return req, nil
279}
280
281func runWithRetries(method, contentType, url string, body string) (
282 *x.QueryResWithData, []byte, error) {

Callers 1

runWithRetriesForRespFunction · 0.85

Calls 1

SetMethod · 0.65

Tested by

no test coverage detected