#-- everything from the FORM here (nerver use colons here): my@form_fields= ( csrf_token => $csrf_token, #-- above looks right, according to form example subscribees => "$name <$email>", setmemberopts_btn => 'Submit Your Changes', send_notifications_to_list_owner" => "1" ); #-- read the API-doc: IF the csrf_token is required in the header # (use colons to prevent canonicalisation): my @headers = ( ':csrf_token' => $csrf_token, ':member_verbosity_threshold' => 0, 'User-Agent' => 'Mozilla/5.0' ); my $res = $ua->request(POST $_[0], @headers, Content => \@form_fields );