http.post problems with base64 encoded data

R

Randy Lawrence

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', 80 ) {|http|
response = http.post( '/ruby/changeip.rbx',
"foo=#{somedata}" )
puts response.body
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,740
Latest member
AdolphBig6

Latest Threads

Top