---
title: "Methods to Submit a Form With POST Using {Curl | Perl | Python | Ruby | Lynx}"
description: "Assume that you have a form , in the source look for something similar to : input name=’rid’ type=’TEXT’ input name=’submit’."
url: "https://h3manth.com/scribe/methods-submit-form-post-using-curl-perl-python-ruby-lynx/"
canonical_url: "https://h3manth.com/scribe/methods-submit-form-post-using-curl-perl-python-ruby-lynx/"
markdown_url: "https://h3manth.com/scribe/blog/methods-submit-form-post-using-curl-perl-python-ruby-lynx.md"
publishDate: "2009-07-15T00:00:00.000Z"
author: "Hemanth HM"
category: "python"
tags: ["ruby","python","bash","web"]
word_count: 184
reading_time_minutes: 1
x_markdown_tokens: 424
content_signal: "ai-train=yes, search=yes, ai-input=yes"
---

# Methods to Submit a Form With POST Using {Curl | Perl | Python | Ruby | Lynx}

> Assume that you have a form , in the source look for something similar to : input name=’rid’ type=’TEXT’ input name=’submit’.

Assume that you have a form , in the source look for something similar to :

` input name="rid" type="TEXT" input name="submit" value="SUBMIT" type="SUBMIT" align="center" `

Then , based on your needs select any of the methods to POST the data to the form and get the required results back

Using curl : ` curl -s -d "rid=value%&submit=SUBMIT"  > out.html `

Using Lynx to dump data : ` curl -sd 'rid=1ap05cs013&submit=SUBMIT'  | lynx -dump -nolist -stdin > out.html `

Using Perl :

``

## !/usr/bin/perl -w

use strict; use LWP::UserAgent; use warnings;

sub send_to {
    
    
    my $browser  = LWP::UserAgent->new;
    my $response = $browser->post(
        'URL',
        [
            'rid'    => $rid,  
            'submit' => 'SUBMIT'
        ],
    );
    
    print ( $response->content );
    

}

Using Python :

``

## !/usr/bin/env python

import urllib

## URL to post to

url = 'URL' values = {'rid': rid,
    
    
            'submit': 'SUBMIT'}
    

html = urllib.urlopen(url, urllib.urlencode(values)).read() print html

Using Ruby : ` require "uri" require "net/http" uri = URI.parse('URL') req = Net::HTTP::Post.new('URL')`

req.set_form_data({ 'rid' => 'value',   
'submit' => 'SUBMIT' }) res = Net::HTTP.new(uri.host, uri.port).start { |http| http.request(req) } File.open('out.htm', 'w') { |f| f.write res.body }
