problems with base64 encoded data

I can do using simple variable values but I'm having some problems with using base64 encoded data.

For example, if I set 'somedata' to a simple string, the following code works. But if I take more complex data (like rsa signature) and encode it using Base64.encode64(somedata), I get a "permission denied" web server message.

I'm wondering if this is caused by base64-encoded data resulting in some '=' characters and if so, how do I work around this?



require 'net/http'
require 'base64'

somedata = 'hello'
#somedata = Base64.encode64('%FYG#&*^G#uyg6t76gkjhkjhf*...')

Net::HTTP.start( '', 80 ) {|http|
     response = '/ruby/changeip.rbx',
                             "foo=#{somedata}" )
     puts response.body