Hi,
I am try to configure a modem that has a http-api.
When I capture what the browser-based GUI does I can see that it sends http-headers that look like this:
__RequestVerificationToken: acP92nszWSeNIAeL/Al9Rj24scVQXt+o
This is what I try to replicate in a perl-script.
What I do is this:
my $mech = WWW::Mechanize->new;
my $r = HTTP::Request->new("POST", $some_url);
$r->header("__RequestVerificationToken" => $key);
# set content and some other headers here
$mech->request($r);
But when I capture what the script sends I find that the leading underscores seem to get replaced with minuses, i.e.
--RequestVerificationToken: whatever
So my question is: Why is that and how can I turn it off so I can send headers with leading double-underscores?
Many thanks!
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.