# Return text from Kibana server plugin

**URL:** <https://discuss.elastic.co/t/return-text-from-kibana-server-plugin/124063>\
**Category:** Kibana\
**Created:** [March 15, 2018, 10:07am UTC](https://discuss.elastic.co/t/return-text-from-kibana-server-plugin/124063 "2018-03-15T10:07:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pjh](https://avatars.discourse-cdn.com/v4/letter/p/f19dbf/32.png) [@pjh](https://discuss.elastic.co/u/pjh)\
**Post date:** [March 15, 2018, 10:07am UTC](https://discuss.elastic.co/t/return-text-from-kibana-server-plugin/124063/1 "2018-03-15T10:07:58Z")

</div>

When I try to return plain text from the reply callback, it doesn't seem to work - it just hangs. Does anybody have any ideas as to why?

```
export default function (server) {

  server.route({
    path: '/metrics',
    method: 'GET',
    handler(req, reply) {
      return 'ok'
    }
  });
}

```

When I return reply("text") it returns "text" surrounded in html tags

---

<div class="post-metadata">

**Author:** ![pjh](https://avatars.discourse-cdn.com/v4/letter/p/f19dbf/32.png) [@pjh](https://discuss.elastic.co/u/pjh)\
**Post date:** [March 15, 2018, 3:39pm UTC](https://discuss.elastic.co/t/return-text-from-kibana-server-plugin/124063/2 "2018-03-15T15:39:53Z")

</div>

so after a bit of playing about, it helps to have both type and encoding chained to the function

`reply(thing).type('text/plain').encoding('binary')`

Hope that hopes anyone looking for the same solution.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 12, 2018, 3:40pm UTC](https://discuss.elastic.co/t/return-text-from-kibana-server-plugin/124063/3 "2018-04-12T15:40:01Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
