How do make it post instead of get?

This script will GET the page i request when i call it from dos-prompt
like this “ruby nukeuser.rb 1”

require ‘uri’
require ‘net/https’

user_id = ARGV[0].strip
url = “https:///services_captiveportal_users.php?act=del&id=” + user_id

url1 = URI.parse(url)

http =, url1.port)
http.use_ssl = true

Do not warn us about certificate - blithely accept whatever

certificate we receive!
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

req =
req.basic_auth ‘username’, ‘password’

res = http.start do |h|

print res.body

But i really need to POST… and cant figure out how to make it do that
Can someone please help - i am loosing my hair fast at the moment!


req =


req =


On Wed, Jul 9, 2008 at 2:33 PM, Flemming Munk jensen <
[email protected]> wrote:

Can someone please help - i am loosing my hair fast at the moment!

Posted via

Paul S.
DCI Level 2 Judge, Bath FNM Organiser

Upcoming events in Bath -
July 12th Eventide Prerelease (Standard)

[email protected]

Paul S. wrote:


req =


req =


Well… that run’s without any errors too, but i dont get the result i
would like.

I think i will explain a little more about what i am trying to do :wink:

I have a webpage on a m0n0wall (see where you can
do some user management. On this page is a link that is marked up like

Now what i want ruby to do is call the page
services_captiveportal_users.php with the action “act=del” and the
apropriate “id=?”, so i can delete users this way.

What happens so far, is i get the page with a list of all users
currently registered, wich is ok, but the user id i request to be
deleted is not deleted??

Is it maybe because of the "onclick=“return…blah” in the href??
I have the feeling i am missing some basic law of nature here, and in
the process of embarassing myself bigtime…

Thanks in advantage


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs