# Authorization header using ActiveResouce

**URL:** <https://www.ruby-forum.com/t/authorization-header-using-activeresouce/148733>\
**Category:** Rails\
**Created:** [September 16, 2008, 6:15pm UTC](https://www.ruby-forum.com/t/authorization-header-using-activeresouce/148733 "2008-09-16T18:15:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben.koski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b487fb/32.png) [@ben.koski](https://www.ruby-forum.com/u/ben.koski)\
**Post date:** [September 16, 2008, 6:15pm UTC](https://www.ruby-forum.com/t/authorization-header-using-activeresouce/148733/1 "2008-09-16T18:15:27Z")

</div>

I’m trying to use ActiveResource in a ruby script to consume a web  
service that requires simple HTTP authentication. From the docs, this  
seems like it should be trivial:

require ‘rubygems’  
require ‘activeresource’ #I’m on 2.1.0

class List \< ActiveResource::Base  
self.logger = Logger.new STDOUT

```
self.site = 'http://myuser:removed_email_address@domain.invalid'

```

end

But when I try to use the model, it throws back a 401–even though the  
same resource works just fine when invoked from a web browser. When I  
looked at the outbound traffic using WireShark, the Authorization  
header isn’t even there.

Any hints/suggestions?

Thanks,  
Ben
