MCPcopy Create free account
hub / github.com/LevInteractive/imageup / jsonResponse

Function jsonResponse

imageup.go:58–62  ·  view source on GitHub ↗

Provision the response for a json payload.

(w http.ResponseWriter, code int, data interface{})

Source from the content-addressed store, hash-verified

56
57// Provision the response for a json payload.
58func jsonResponse(w http.ResponseWriter, code int, data interface{}) {
59 w.Header().Set("Content-Type", "application/json")
60 w.WriteHeader(code)
61 json.NewEncoder(w).Encode(data)
62}
63
64// Remove all files in array. This is used to clean up something that went
65// wrong.

Callers 1

handleRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected