MCPcopy Create free account
hub / github.com/erpc/erpc / SafeReadBody

Function SafeReadBody

util/testing.go:373–383  ·  view source on GitHub ↗
(request *http.Request)

Source from the content-addressed store, hash-verified

371}
372
373func SafeReadBody(request *http.Request) string {
374 if request.Body == nil {
375 return ""
376 }
377 body, err := io.ReadAll(request.Body)
378 if err != nil {
379 return ""
380 }
381 request.Body = io.NopCloser(bytes.NewBuffer(body))
382 return string(body)
383}
384
385func AssertNoPendingMocks(t *testing.T, expected int) {
386 totalPending := len(gock.Pending())

Calls

no outgoing calls