MCPcopy Create free account
hub / github.com/evcc-io/evcc / jsonWrite

Function jsonWrite

server/http_site_handler.go:84–87  ·  view source on GitHub ↗
(w http.ResponseWriter, data any)

Source from the content-addressed store, hash-verified

82}
83
84func jsonWrite(w http.ResponseWriter, data any) {
85 w.Header().Set("Content-Type", "application/json")
86 json.NewEncoder(w).Encode(data)
87}
88
89func jsonError(w http.ResponseWriter, status int, err error) {
90 w.WriteHeader(status)

Callers 15

energyHistoryHandlerFunction · 0.70
remoteClientsHandlerFunction · 0.70
apiKeyStatusHandlerFunction · 0.70
regenerateApiKeyHandlerFunction · 0.70
templatesHandlerFunction · 0.70
productsHandlerFunction · 0.70
sessionHandlerFunction · 0.70
deleteSessionHandlerFunction · 0.70

Calls 3

HeaderMethod · 0.80
EncodeMethod · 0.65
SetMethod · 0.45

Tested by

no test coverage detected