# Kibana plugin reply with custom headers

**URL:** <https://discuss.elastic.co/t/kibana-plugin-reply-with-custom-headers/154607>\
**Category:** Kibana\
**Created:** [October 30, 2018, 10:01am UTC](https://discuss.elastic.co/t/kibana-plugin-reply-with-custom-headers/154607 "2018-10-30T10:01:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![undwood](https://avatars.discourse-cdn.com/v4/letter/u/a88e57/32.png) [@undwood](https://discuss.elastic.co/u/undwood)\
**Post date:** [October 30, 2018, 10:01am UTC](https://discuss.elastic.co/t/kibana-plugin-reply-with-custom-headers/154607/1 "2018-10-30T10:01:13Z")

</div>

Hello.  
There is registered routing for kibana plugin.

server.route({  
path:'/api/data/export.csv',  
method:'GET',  
handler(req, reply) {  
let respData ='abc,def,ghi,jkl\n';  
respData+= '1,2,3,4\n';  
reply(respData); }})

As you can see, it returns some csv 'text'. Is it possible to setup something, that it will have some other content-type? And browser will download data on this link, as a file?

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [October 30, 2018, 4:29pm UTC](https://discuss.elastic.co/t/kibana-plugin-reply-with-custom-headers/154607/2 "2018-10-30T16:29:40Z")

</div>

Hey @undwood, the `reply` interface comes from [hapi](https://hapijs.com/api), so you can set the content-type like the following

```auto
reply(respData).type('text/csv')

```

---

<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:** [November 27, 2018, 4:30pm UTC](https://discuss.elastic.co/t/kibana-plugin-reply-with-custom-headers/154607/3 "2018-11-27T16:30:34Z")

</div>

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