text.go 480 B

1234567891011121314
  1. // SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
  2. // SPDX-License-Identifier: Apache-2.0
  3. package response // import "miniflux.app/v2/internal/http/response"
  4. import "net/http"
  5. // Text writes a standard text response with a status 200 OK.
  6. func Text(w http.ResponseWriter, r *http.Request, body string) {
  7. builder := NewBuilder(w, r)
  8. builder.WithHeader("Content-Type", `text/plain; charset=utf-8`)
  9. builder.WithBodyAsString(body)
  10. builder.Write()
  11. }