# Add custom headers in AbstractRestResponse childs alternatives

**URL:** https://discuss.elastic.co/t/add-custom-headers-in-abstractrestresponse-childs-alternatives/12075
**Category:** Elasticsearch
**Created:** [May 22, 2013, 2:02pm UTC](https://discuss.elastic.co/t/add-custom-headers-in-abstractrestresponse-childs-alternatives/12075 "2013-05-22T14:02:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![David\_G\_Ortega](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_g_ortega/32/46359_2.png) [@David\_G\_Ortega](https://discuss.elastic.co/u/David_G_Ortega)
#### Post date: [May 22, 2013, 2:02pm UTC](https://discuss.elastic.co/t/add-custom-headers-in-abstractrestresponse-childs-alternatives/12075/1 "2013-05-22T14:02:49Z")

</div>

Howdy guys!!

I have tried to use the addHeaders that comes with the not yet available  
new code of AbstractRestReponse without noticing that the modification is  
just a few days ago... it should be in my 0.90 jar but its not... (this  
drove me crazy)

[https://github.com/elasticsearch/elasticsearch/blob/0.90/src/main/java/org/elasticsearch/rest/AbstractRestResponse.java](https://github.com/elasticsearch/elasticsearch/blob/0.90/src/main/java/org/elasticsearch/rest/AbstractRestResponse.java) (note  
the branch and not the master)

I need to put custom headers in the rest response which options do I have?  
I would be really interested in other solutions since Im using 0.19 still  
in production and I would like to have my plugin working with it...

Any help would be really welcome

Thanks a lot guys

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![David\_G\_Ortega](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_g_ortega/32/46359_2.png) [@David\_G\_Ortega](https://discuss.elastic.co/u/David_G_Ortega)
#### Post date: [May 22, 2013, 2:23pm UTC](https://discuss.elastic.co/t/add-custom-headers-in-abstractrestresponse-childs-alternatives/12075/2 "2013-05-22T14:23:19Z")

</div>

I have seen also the code of HttpRedirectRestResponse just in case was  
using headers but its using HTML  
Would not be better yo use the Location: header?  
I wonder if curl can follow that redirection...

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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: [July 6, 2017, 2:35am UTC](https://discuss.elastic.co/t/add-custom-headers-in-abstractrestresponse-childs-alternatives/12075/3 "2017-07-06T02:35:24Z")

</div>


