[Mailman-Users] Subscribe/unsubscribe with CGI script?
Tom Browder
tom.browder at gmail.com
Tue May 14 13:41:50 CEST 2013
On Tue, May 14, 2013 at 1:04 AM, Krylov Ivan <krylov.r00t at gmail.com> wrote:
> Tom Browder wrote:
>>
>> my $response = $browser->post(
>>
>> "https://host.org/cgi-bin/mailman/$oper/$list",
>> email => $enc_email,
>> fullname => $enc_name,
>> );
>
>
> LWP::UserAgent documentation says on the ->post() method:
>>
>> This method will use the POST() function from
>> "HTTP::Request::Common"
>
>> to build the request. See HTTP::Request::Common for a
>> details on how to pass form content and
>> other advanced features.
>
> The request form you needed is POST($url, {field => "value"}), otherwise you
> will create HTTP headers, not POST data.
I made two errors pointed out by Ivan: (1) I dumbly forgot to wrap the
hash args in curly braces and (2) I should NOT have encoded the field
values.
With those two corrections all works well!
Thanks very much, Ivan.
Best regards,
-Tom
More information about the Mailman-Users
mailing list