Using WWW :: Mechanize, how to add underline header with underline?

I use an API that requires me to use a header named "m_id" for the request.

When i use

$mech->add_header('m_id' => 'whatever')

WWW :: Mechanize (or rather HTTP :: Headers) "useful" changes the header name to "M-Id". What does not work.

Is there any way to prevent this?

+4
source share
1 answer

I thought RTFMed before publishing, but not good enough ... The second, read via HTTP :: Headers perldoc , told me to use:

$mech->add_header(':m_id'=>'whatever');

and that does the trick.

+8
source

Source: https://habr.com/ru/post/1609861/


All Articles