text.go 451 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. NewBuilder(w, r).
  8. WithHeader("Content-Type", `text/plain; charset=utf-8`).
  9. WithBodyAsString(body).
  10. Write()
  11. }