Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Injecting a value into HTTP::Header

by Bod (Curate)
on Apr 19, 2021 at 12:51 UTC ( #11131470=note: print w/replies, xml ) Need Help??


in reply to Re: Injecting a value into HTTP::Header
in thread Injecting a value into HTTP::Header

Hi, "not managing to get the injection to work" doesn't really describe the problem well

Sorry - yes, re-reading my question shows it is not very clear.

What I meant was that injecting the token_type parameter is not working. My sub doesn't throw an error but causes the super class sub to throw an error that token_type is missing.

push_header() since that does not appear as a documented method on an HTTP::Response object

HTTP::Response extends HTTP::Message which requires's HTTP::Headers and push_header() is a method of this class.

Although looking at the link you provided sparked the realisation that token_type is not a header at all. It needs to be added to the content rather than the header. So I think I am going to have to decode the JSON content to a Perl data structure, add the token_type parameter before encoding it back to JSON and passing that to the super class' sub.

I can see running into propblems with the encoding as there doesn't appear to be a way to reverse the effects of decoded_content

Replies are listed 'Best First'.
Re^3: Injecting a value into HTTP::Header
by 1nickt (Abbot) on Apr 19, 2021 at 13:10 UTC

    Never mnind, sry, not enough coffee.

    You misunderstand how the inheritance works. See the doc I linked to and run some minimal tests.


    The way forward always starts with a minimal test.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11131470]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2022-01-27 00:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (70 votes). Check out past polls.

    Notices?