OK, I'm real confused now. I notice that my form has, in fact, stopped working. to clarify: I only noticed that there were underscores -- I didn't notice that the colons were still there and that, in fact, the program didn't work}. My guess is that the server doesn't like the colons.. :o) {As for the X-, not my choice: I simply scrape the form I get and try to return the right fields}. I didn't understand what you told me about the content/headers stuff. Here is {part of the} actual form I fetched
<FORM action="...members/add" method="POST" enctype="multipart/form-da +ta"> <input type="hidden" name="csrf_token" value="280200000069c97e705b7347 +000000746573746c6973742d66616e746173796661726d2e636f6d2b61646d696e3a3 +763663438346436393036323038363738613566383231623461323132353762356361 +3763633665"> [...] <INPUT name="send_notifications_to_list_owner" type="RADIO" value="0" +> <INPUT name="send_notifications_to_list_owner" type="RADIO" value="1" + CHECKED > <TEXTAREA NAME=subscribees ROWS=10 COLS=70%></TEXTAREA> [...] <INPUT name="setmemberopts_btn" type="SUBMIT" value="Submit Your Chang +es" >
Then what I do is set up a @fields array with
@fields= ( ":csrf_token" => $csrf_token subscribees => "$name <$email>", ":setmemberopts_btn" => 'Submit Your Changes', ":send_notifications_to_list_owner" => "1", ); $res = $ua->request(POST $_[0], \@fields);
and that not only doesn't work, but gets me an ugly
<h3><strong><font color="red" size="+2">Error: </font></strong><em>The + form lifetime has expired. (request forgery check)</em></h3><center> +<h2>Testlist mailing list administration<br>Membership&nbsp;Managemen +t... Section</h2></center><hr>
I'm not sure what they check for the 'lifetime' but I bet it is the csrf_token. and I see in the request that every field name now has a colon in front of it {except for the fields that showed up in the request-content; they all have %3's in front of them}. So I feel trapped; is there a way to pass the underscores through to the server, but without the colons?? {short of my going into HTTP::Headers and actually tweaking the code to never "canonicalize"}

2018-08-13 Athanasius fixed code tag placement


In reply to Re^4: POST fieldnames with underscores by BernieC
in thread POST fieldnames with underscores by BernieC

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.