From: Randy Lawrence Date: 2004-07-05T05:49:02+09:00 Subject: Re: http.post() problem only when using base64-encoded data Randy Lawrence wrote: > I'm able to do a simple http.post() but when the data I'm posting is > more complex than a simple string, I get a "permission denied" Apache > error. > > One possibility is that encoding the data with base64 can result in > having '=' characters. I'd really appreciate it if anyone can provide > some tips on how I can successfully http.post() more complex strings > without resorting to file uploads. > > Here's the script I'm using (it fails only when somedata is assigned a > complex string such as base64-encoded rsa signature): > > ---- > require 'net/http' > somedata = 'hello' > > Net::HTTP.start( 'www.somedomainxyz123.com', 80 ) {|http| > response = http.post( '/ruby/testpost.rbx', > "foo=#{somedata}" ) > puts response.body > } > ---- > Problem solved. It turned out to be web server security settings forbidding character values outside of 32-126 range. The base64 encoding was including carriage returns (10) which triggered the error.