# Http.post problems with base64 encoded data

**URL:** <https://rubytalk.org/t/http-post-problems-with-base64-encoded-data/12406>\
**Category:** ruby-talk\
**Created:** [4 July 2004 19:44 UTC](https://rubytalk.org/t/http-post-problems-with-base64-encoded-data/12406 "2004-07-04T19:44:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Randy\_Lawrence](https://avatars.discourse-cdn.com/v4/letter/r/5f9b8f/32.png) [@Randy\_Lawrence](https://rubytalk.org/u/Randy_Lawrence)\
**Post date:** [4 July 2004 19:44 UTC](https://rubytalk.org/t/http-post-problems-with-base64-encoded-data/12406/1 "2004-07-04T19:44:02Z")

</div>

I can do http.post using simple variable values but I'm having some problems with http.post 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( '[www.innerveil.com](http://www.innerveil.com)', 80 ) {|http|  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;response = http.post( '/ruby/changeip.rbx',  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"foo=#{somedata}" )  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts response.body  
> }
