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

Function SendResponseWithMessage

api/api.go:225–231  ·  view source on GitHub ↗

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

(w http.ResponseWriter, result interface{}, message string, code int)

Source from the content-addressed store, hash-verified

223// provided message, sets the JSON header, and writes to the
224// http.ResponseWriter.
225func SendResponseWithMessage(w http.ResponseWriter, result interface{}, message string, code int) error {
226 response := NewSuccessResponseWithMessage(result, message, code)
227 w.Header().Set("Content-Type", "application/json")
228 enc := json.NewEncoder(w)
229 err := enc.Encode(response)
230 return err
231}

Callers 3

HandleMethod · 0.92
HandleMethod · 0.92
HandleMethod · 0.92

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…