Post data with Apache2::Request
Post data with Apache2::Request
am 25.05.2008 00:57:19 von kropotkin
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-tp 17452698p17452698.html
Sent from the mod_perl - General mailing list archive at Nabble.com.
Re: Post data with Apache2::Request
am 25.05.2008 20:24:31 von Tyler Gee
On Sat, May 24, 2008 at 4:57 PM, kropotkin 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-tp 17452698p17452698.html
> Sent from the mod_perl - General mailing list archive at Nabble.com.
>
>
--
~Tyler
Re: Post data with Apache2::Request
am 25.05.2008 21:26:40 von kropotkin
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
> 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-tp 17452698p17452698.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-tp 17452698p17461443.html
Sent from the mod_perl - General mailing list archive at Nabble.com.
Re: Post data with Apache2::Request
am 25.05.2008 21:47:30 von kropotkin
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
>> 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-tp 17452698p17452698.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-tp 17452698p17461631.html
Sent from the mod_perl - General mailing list archive at Nabble.com.
Re: Post data with Apache2::Request
am 26.05.2008 04:40:24 von Foo JH
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.
Re: Post data with Apache2::Request
am 26.05.2008 05:36:40 von Ben van Staveren
--Apple-Mail-2--609917274
Content-Type: text/plain;
charset=US-ASCII;
format=flowed;
delsp=yes
Content-Transfer-Encoding: 7bit
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 :)
--Apple-Mail-2--609917274
Content-Disposition: attachment;
filename=smime.p7s
Content-Type: application/pkcs7-signature;
name=smime.p7s
Content-Transfer-Encoding: base64
MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEH AQAAoIIGMTCCAuow
ggJToAMCAQICEDjirzgNka9HfTjTG17O2rAwDQYJKoZIhvcNAQEFBQAwYjEL MAkGA1UEBhMCWkEx
JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNV BAMTI1RoYXd0ZSBQ
ZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA3MTExNjA1MjA1NFoX DTA4MTExNT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iG9w0BCQMxCwYJKoZIhvcNAQcBMBwG CSqGSIb3DQEJBTEP
Fw0wODA1MjYwMzM2NDBaMCMGCSqGSIb3DQEJBDEWBBSfT0fOzRFs2s0Y5qil ZLFXPxCsLzCBhQYJ
KwYBBAGCNxAEMXgwdjBiMQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3Rl IENvbnN1bHRpbmcg
KFB0eSkgTHRkLjEsMCoGA1UEAxMjVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWls IElzc3VpbmcgQ0EC
EDjirzgNka9HfTjTG17O2rAwgYcGCyqGSIb3DQEJEAILMXigdjBiMQswCQYD VQQGEwJaQTElMCMG
A1UEChMcVGhhd3RlIENvbnN1bHRpbmcgKFB0eSkgTHRkLjEsMCoGA1UEAxMj VGhhd3RlIFBlcnNv
bmFsIEZyZWVtYWlsIElzc3VpbmcgQ0ECEDjirzgNka9HfTjTG17O2rAwDQYJ KoZIhvcNAQEBBQAE
ggEAL47QNGXedbAT5SZkb/EMPhCzxw72sP+1wxUU31MowMiwF3r2fXNnP8mU 4gtknRtcMcmv2oNJ
3Ro5QlPsWAis+IQ1Lq7n0P2hPapwp9nuS9B0tehzzHPbXx4CdefaEwbyDiAt DVYwrZymyZjDS4Qu
PsW7t0N3r0+ZkbEzwWrAAQkZGh3NiTitSRliTS7NAygweLgOZlHm8PvMJLNK 5qHgNsG4vQBhLphX
dvxkjXKwDp5ExMRa79q3j4F1xPtPEEpw0ycPqOXUelBaBx9pAzhXcN/xrmOe 1Vvp2aumU2FLPUmg
D/9d7bZWFvP+TjPvsjBwfWMopZsjiq6Zw2q/UeJVcwAAAAAAAA==
--Apple-Mail-2--609917274--
Re: Post data with Apache2::Request
am 26.05.2008 18:29:31 von kropotkin
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-tp 17452698p17474985.html
Sent from the mod_perl - General mailing list archive at Nabble.com.