# Including nil HTTP header

**URL:** <https://www.ruby-forum.com/t/including-nil-http-header/119976>\
**Category:** Ruby\
**Created:** [November 12, 2007, 5:01pm UTC](https://www.ruby-forum.com/t/including-nil-http-header/119976 "2007-11-12T17:01:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![el2king](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/f08c70/32.png) [@el2king](https://www.ruby-forum.com/u/el2king)\
**Post date:** [November 12, 2007, 5:01pm UTC](https://www.ruby-forum.com/t/including-nil-http-header/119976/1 "2007-11-12T17:01:06Z")

</div>

I am trying to connect to a web service with an HTTP request, and I am  
working around with the HTTP headers. I am able to create my own custom  
headers for the HTTP request, and everything is fine when the header has  
a non-nil value associated to it. However, when I try to set a nil  
value to a custom HTTP header, I do not the header included in the HTTP  
message. Is there a way to include a header with a nil value in the  
HTTP message? Thanks!

---

<div class="post-metadata">

**Author:** ![el2king](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/f08c70/32.png) [@el2king](https://www.ruby-forum.com/u/el2king)\
**Post date:** [November 12, 2007, 5:09pm UTC](https://www.ruby-forum.com/t/including-nil-http-header/119976/2 "2007-11-12T17:09:46Z")

</div>

Just out of the top of my head: what about setting the header entry to  
an empty string value ("")?
