MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / Request

Function Request

rest/utilities_testing.go:1215–1224  ·  view source on GitHub ↗
(method, resource, body string)

Source from the content-addressed store, hash-verified

1213}
1214
1215func Request(method, resource, body string) *http.Request {
1216 request, err := http.NewRequest(method, "http://localhost"+resource, bytes.NewBufferString(body))
1217 if err != nil {
1218 panic(fmt.Sprintf("http.NewRequest failed: %v", err))
1219 }
1220 request.RemoteAddr = "test.client.addr:99999" // usually populated by actual HTTP requests going into a HTTP Server
1221 request.RequestURI = resource // This doesn't get filled in by NewRequest
1222 FixQuotedSlashes(request)
1223 return request
1224}
1225
1226func RequestByUser(method, resource, body, username string) *http.Request {
1227 r := Request(method, resource, body)

Callers 15

TestRequestFunction · 0.85
TestViewQueryUserAccessFunction · 0.85
TestUserViewQueryFunction · 0.85
TestBytesReadGzipRequestFunction · 0.85
SendRequestMethod · 0.85
SendMetricsRequestMethod · 0.85
SendDiagnosticRequestMethod · 0.85

Calls 1

FixQuotedSlashesFunction · 0.85

Tested by 4

TestRequestFunction · 0.68
TestViewQueryUserAccessFunction · 0.68
TestUserViewQueryFunction · 0.68
TestBytesReadGzipRequestFunction · 0.68