P
Patrick
Hi,
Im a beginner in Ruby, but with skills in other programming languages.
I tried to execute the following code:
require 'net/http'
require 'uri'
#1: Simple POST
res =
Net::HTTP.post_form(URI.parse('http://www.example.com/search.cgi'),
{'q'=>'ruby', 'max'=>'50'})
puts res.body
I got the code from http://www.ruby-doc.org/stdlib/ -> net/http. Of
course, I replaced the Site ("www.example.com...") with my site
(because i want to send informations to a php-programm).
But the console does the following output:
mypath/ruby/lib/ruby/1.8/net/protocol.rb:175:in `write': Invalid
argument (Errno::EI
NVAL)
from mypath/ruby/lib/ruby/1.8/net/protocol.rb:175:in `write0'
from mypath/ruby/lib/ruby/1.8/net/protocol.rb:151:in `write'
from mypath/ruby/lib/ruby/1.8/net/protocol.rb:166:in `writing'
from mypath/ruby/lib/ruby/1.8/net/protocol.rb:150:in `write'
from mypath/ruby/lib/ruby/1.8/net/http.rb:1542:in
`write_header'
from mypath/ruby/lib/ruby/1.8/net/http.rb:1513:in
`send_request_with_body'
from mypath/ruby/lib/ruby/1.8/net/http.rb:1496:in `exec'
from mypath/ruby/lib/ruby/1.8/net/http.rb:1044:in `request'
from mypath/ruby/lib/ruby/1.8/net/http.rb:405:in `post_form'
from mypath/ruby/lib/ruby/1.8/net/http.rb:545:in `start'
from mypath/ruby/lib/ruby/1.8/net/http.rb:404:in `post_form'
from mypath/php.rb:5
Line 5 is: res =
Net::HTTP.post_form(URI.parse('http://www.example.com/search.cgi'),
{'q'=>'ruby', 'max'=>'50'})
I thought my ruby is maybe damaged, so i deleted it, and installed it
new. But i get always the same error.
I hope anyone would be so kind and can help me.
Thank you,
Patrick
Im a beginner in Ruby, but with skills in other programming languages.
I tried to execute the following code:
require 'net/http'
require 'uri'
#1: Simple POST
res =
Net::HTTP.post_form(URI.parse('http://www.example.com/search.cgi'),
{'q'=>'ruby', 'max'=>'50'})
puts res.body
I got the code from http://www.ruby-doc.org/stdlib/ -> net/http. Of
course, I replaced the Site ("www.example.com...") with my site
(because i want to send informations to a php-programm).
But the console does the following output:
mypath/ruby/lib/ruby/1.8/net/protocol.rb:175:in `write': Invalid
argument (Errno::EI
NVAL)
from mypath/ruby/lib/ruby/1.8/net/protocol.rb:175:in `write0'
from mypath/ruby/lib/ruby/1.8/net/protocol.rb:151:in `write'
from mypath/ruby/lib/ruby/1.8/net/protocol.rb:166:in `writing'
from mypath/ruby/lib/ruby/1.8/net/protocol.rb:150:in `write'
from mypath/ruby/lib/ruby/1.8/net/http.rb:1542:in
`write_header'
from mypath/ruby/lib/ruby/1.8/net/http.rb:1513:in
`send_request_with_body'
from mypath/ruby/lib/ruby/1.8/net/http.rb:1496:in `exec'
from mypath/ruby/lib/ruby/1.8/net/http.rb:1044:in `request'
from mypath/ruby/lib/ruby/1.8/net/http.rb:405:in `post_form'
from mypath/ruby/lib/ruby/1.8/net/http.rb:545:in `start'
from mypath/ruby/lib/ruby/1.8/net/http.rb:404:in `post_form'
from mypath/php.rb:5
Line 5 is: res =
Net::HTTP.post_form(URI.parse('http://www.example.com/search.cgi'),
{'q'=>'ruby', 'max'=>'50'})
I thought my ruby is maybe damaged, so i deleted it, and installed it
new. But i get always the same error.
I hope anyone would be so kind and can help me.
Thank you,
Patrick