MCPcopy Create free account
hub / github.com/OCEChain/OCEChain / ReadRESTReq

Function ReadRESTReq

client/utils/rest.go:157–171  ·  view source on GitHub ↗

* ReadRESTReq is a simple convenience wrapper that reads the body and unmarshals to the req interface. Usage: type SomeReq struct { BaseReq `json:"base_req"` CustomField string `json:"custom_field"` } req := new(SomeReq) err := ReadRESTReq(w, r, cdc, req) */

(w http.ResponseWriter, r *http.Request, cdc *codec.Codec, req interface{})

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls 3

WriteErrorResponseFunction · 0.85
ErrorMethod · 0.45
UnmarshalJSONMethod · 0.45

Tested by

no test coverage detected