MCPcopy Create free account
hub / github.com/cloudflare/cfssl / SendResponse

Function SendResponse

api/api.go:214–220  ·  view source on GitHub ↗

SendResponse builds a response from the result, sets the JSON header, and writes to the http.ResponseWriter.

(w http.ResponseWriter, result interface{})

Source from the content-addressed store, hash-verified

212// SendResponse builds a response from the result, sets the JSON
213// header, and writes to the http.ResponseWriter.
214func SendResponse(w http.ResponseWriter, result interface{}) error {
215 response := NewSuccessResponse(result)
216 w.Header().Set("Content-Type", "application/json")
217 enc := json.NewEncoder(w)
218 err := enc.Encode(response)
219 return err
220}
221
222// SendResponseWithMessage builds a response from the result and the
223// provided message, sets the JSON header, and writes to the

Callers 12

HandleMethod · 0.92
HandleMethod · 0.92
HandleMethod · 0.92
HandleMethod · 0.92
HandleMethod · 0.92
HandleMethod · 0.92
HandleMethod · 0.92
HandleMethod · 0.92
HandleMethod · 0.92
gencrlHandlerFunction · 0.92
simpleHandleFunction · 0.85
cleverHandleFunction · 0.85

Calls 1

NewSuccessResponseFunction · 0.85

Tested by 2

simpleHandleFunction · 0.68
cleverHandleFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…