MCPcopy Index your code
hub / github.com/dnote/dnote / MakeReq

Function MakeReq

pkg/server/testutils/main.go:161–171  ·  view source on GitHub ↗

MakeReq makes an HTTP request and returns a response

(endpoint string, method, path, data string)

Source from the content-addressed store, hash-verified

159
160// MakeReq makes an HTTP request and returns a response
161func MakeReq(endpoint string, method, path, data string) *http.Request {
162 u := fmt.Sprintf("%s%s", endpoint, path)
163
164 req, err := http.NewRequest(method, u, strings.NewReader(data))
165
166 if err != nil {
167 panic(errors.Wrap(err, "constructing http request"))
168 }
169
170 return req
171}
172
173// MakeFormReq makes an HTTP request and returns a response
174func MakeFormReq(endpoint, method, path string, data url.Values) *http.Request {

Callers 15

TestGetNotesFunction · 0.92
TestGetNoteFunction · 0.92
TestCreateNoteFunction · 0.92
TestDeleteNoteFunction · 0.92
TestUpdateNoteFunction · 0.92
TestNotSupportedVersionsFunction · 0.92
TestGetBooksFunction · 0.92
TestGetBooksByNameFunction · 0.92
TestGetBookFunction · 0.92
TestGetBookNonOwnerFunction · 0.92
TestCreateBookFunction · 0.92
TestUpdateBookFunction · 0.92

Calls

no outgoing calls

Tested by 15

TestGetNotesFunction · 0.74
TestGetNoteFunction · 0.74
TestCreateNoteFunction · 0.74
TestDeleteNoteFunction · 0.74
TestUpdateNoteFunction · 0.74
TestNotSupportedVersionsFunction · 0.74
TestGetBooksFunction · 0.74
TestGetBooksByNameFunction · 0.74
TestGetBookFunction · 0.74
TestGetBookNonOwnerFunction · 0.74
TestCreateBookFunction · 0.74
TestUpdateBookFunction · 0.74