# Setting headers in TestRequest

**URL:** <https://www.ruby-forum.com/t/setting-headers-in-testrequest/91322>\
**Category:** Rails\
**Created:** [April 6, 2007, 7:18pm UTC](https://www.ruby-forum.com/t/setting-headers-in-testrequest/91322 "2007-04-06T19:18:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rod](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/50afbb/32.png) [@Rod](https://www.ruby-forum.com/u/Rod)\
**Post date:** [April 6, 2007, 7:18pm UTC](https://www.ruby-forum.com/t/setting-headers-in-testrequest/91322/1 "2007-04-06T19:18:19Z")

</div>

Hi. I’m using HTTP Basic auth for some of my REST interfaces, so I  
want to run tests setting the HTTP AUTHORIZATION header. But I can’t  
find a way to do it in the functional test. I can see the response  
headers in @response.headers, but there’s no analogous hash in  
@request.

Any hints?

Also, I can’t find any API documentation for  
ActionController::TestRequest – anybody know where that’s hiding?

Thanks!  
Rod
