Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

Post data with Apache2::Request

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


enquiries at mms-oxford

May 24, 2008, 3:57 PM

Post #1 of 7 (1099 views)
Permalink
Post data with Apache2::Request

Hi

I am trying to obtain POST data from a form.

I have these lines:

my $req = Apache2::Request->new($r);
my $email = $req->body('email');

My form contains a field called 'email'.

However no data.

The line: print $req->body_status(); outputs 'SUCCESS' seeming to indicate
a) that $req as an instance of Apache2::Request and b) that the object
thinks it has got some data?

I have tired sending the data by GET and using : my $email =
$req->param('email') but there was no data there either.

I don't want to use CGI.pm if possible

with thanks

Kropotkin
--
View this message in context: http://www.nabble.com/Post-data-with-Apache2%3A%3ARequest-tp17452698p17452698.html
Sent from the mod_perl - General mailing list archive at Nabble.com.


geekout at gmail

May 25, 2008, 11:24 AM

Post #2 of 7 (1042 views)
Permalink
Re: Post data with Apache2::Request [In reply to]

On Sat, May 24, 2008 at 4:57 PM, kropotkin <enquiries [at] mms-oxford> wrote:
>
> Hi
>
> I am trying to obtain POST data from a form.
>
> I have these lines:
>
> my $req = Apache2::Request->new($r);
> my $email = $req->body('email');

my $email = $req->params('email');

>
> My form contains a field called 'email'.
>
> However no data.
>
> The line: print $req->body_status(); outputs 'SUCCESS' seeming to indicate
> a) that $req as an instance of Apache2::Request and b) that the object
> thinks it has got some data?
>
> I have tired sending the data by GET and using : my $email =
> $req->param('email') but there was no data there either.
>
> I don't want to use CGI.pm if possible
>
> with thanks
>
> Kropotkin
> --
> View this message in context: http://www.nabble.com/Post-data-with-Apache2%3A%3ARequest-tp17452698p17452698.html
> Sent from the mod_perl - General mailing list archive at Nabble.com.
>
>



--
~Tyler


enquiries at mms-oxford

May 25, 2008, 12:26 PM

Post #3 of 7 (1034 views)
Permalink
Re: Post data with Apache2::Request [In reply to]

Hi Tyler

The cpan docs say $req->body('field_name') for POST data and seem to imply
$req->param('field_name') for GET data. Neither work.

I reinstalled libapreq .

I had the same problems with Apache::Request. Could never get POST data out
of that though I could get GET data.

Looks like back to CGI.pm.



regards

Kropotkin


Tyler Gee wrote:
>
> On Sat, May 24, 2008 at 4:57 PM, kropotkin <enquiries [at] mms-oxford>
> wrote:
>>
>> Hi
>>
>> I am trying to obtain POST data from a form.
>>
>> I have these lines:
>>
>> my $req = Apache2::Request->new($r);
>> my $email = $req->body('email');
>
> my $email = $req->params('email');
>
>>
>> My form contains a field called 'email'.
>>
>> However no data.
>>
>> The line: print $req->body_status(); outputs 'SUCCESS' seeming to
>> indicate
>> a) that $req as an instance of Apache2::Request and b) that the object
>> thinks it has got some data?
>>
>> I have tired sending the data by GET and using : my $email =
>> $req->param('email') but there was no data there either.
>>
>> I don't want to use CGI.pm if possible
>>
>> with thanks
>>
>> Kropotkin
>> --
>> View this message in context:
>> http://www.nabble.com/Post-data-with-Apache2%3A%3ARequest-tp17452698p17452698.html
>> Sent from the mod_perl - General mailing list archive at Nabble.com.
>>
>>
>
>
>
> --
> ~Tyler
>
>

--
View this message in context: http://www.nabble.com/Post-data-with-Apache2%3A%3ARequest-tp17452698p17461443.html
Sent from the mod_perl - General mailing list archive at Nabble.com.


enquiries at mms-oxford

May 25, 2008, 12:47 PM

Post #4 of 7 (1029 views)
Permalink
Re: Post data with Apache2::Request [In reply to]

Hi Tyler

Solved! I didn't and should have said I am using Mason. It looks like Mason
gobbled up the POST data. (This must an example of the problem I see
mentioned that the POST data can only be read once). I can then get the POST
data from a Mason variable %ARGS.

regards

Justin


kropotkin wrote:
>
> Hi Tyler
>
> The cpan docs say $req->body('field_name') for POST data and seem to imply
> $req->param('field_name') for GET data. Neither work.
>
> I reinstalled libapreq .
>
> I had the same problems with Apache::Request. Could never get POST data
> out of that though I could get GET data.
>
> Looks like back to CGI.pm.
>
>
>
> regards
>
> Kropotkin
>
>
> Tyler Gee wrote:
>>
>> On Sat, May 24, 2008 at 4:57 PM, kropotkin <enquiries [at] mms-oxford>
>> wrote:
>>>
>>> Hi
>>>
>>> I am trying to obtain POST data from a form.
>>>
>>> I have these lines:
>>>
>>> my $req = Apache2::Request->new($r);
>>> my $email = $req->body('email');
>>
>> my $email = $req->params('email');
>>
>>>
>>> My form contains a field called 'email'.
>>>
>>> However no data.
>>>
>>> The line: print $req->body_status(); outputs 'SUCCESS' seeming to
>>> indicate
>>> a) that $req as an instance of Apache2::Request and b) that the object
>>> thinks it has got some data?
>>>
>>> I have tired sending the data by GET and using : my $email =
>>> $req->param('email') but there was no data there either.
>>>
>>> I don't want to use CGI.pm if possible
>>>
>>> with thanks
>>>
>>> Kropotkin
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Post-data-with-Apache2%3A%3ARequest-tp17452698p17452698.html
>>> Sent from the mod_perl - General mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> ~Tyler
>>
>>
>
>

--
View this message in context: http://www.nabble.com/Post-data-with-Apache2%3A%3ARequest-tp17452698p17461631.html
Sent from the mod_perl - General mailing list archive at Nabble.com.


jhfoo-ml at extracktor

May 25, 2008, 7:40 PM

Post #5 of 7 (1036 views)
Permalink
Re: Post data with Apache2::Request [In reply to]

kropotkin wrote:
> Hi
>
> I am trying to obtain POST data from a form.
>
Try LWP::UserAgent to post forms instead. It's quite easy to use.


benvanstaveren at gmail

May 25, 2008, 8:36 PM

Post #6 of 7 (1021 views)
Permalink
Re: Post data with Apache2::Request [In reply to]

On May 26, 2008, at 9:40 AM, Foo JH wrote:

> kropotkin wrote:
>> Hi
>> I am trying to obtain POST data from a form.
>>
> Try LWP::UserAgent to post forms instead. It's quite easy to use.

Read the subject again. Epic fail at reading comprehension. He's not
trying to post forms anywhere, he's trying to read post form data
using Apache2::Request, whole different end of the spectrum there
sonny :)
Attachments: smime.p7s (2.37 KB)


enquiries at mms-oxford

May 26, 2008, 9:29 AM

Post #7 of 7 (1027 views)
Permalink
Re: Post data with Apache2::Request [In reply to]

Hi Ben

Yes. That is correct. Thanks. LWP::UserAgent is used for something else. In
fact problem solved as per above

regards

Kroptokin




Ben van Staveren wrote:
>
>
> Read the subject again. Epic fail at reading comprehension. He's not
> trying to post forms anywhere, he's trying to read post form data
> using Apache2::Request, whole different end of the spectrum there
> sonny :)
>
>
>
>
>
>

--
View this message in context: http://www.nabble.com/Post-data-with-Apache2%3A%3ARequest-tp17452698p17474985.html
Sent from the mod_perl - General mailing list archive at Nabble.com.

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.