Closed swaggboi closed 1 year ago
Yup. Please see this member of the HTTPAction
parent class.
TLDR: There is a .stash
Hash on each Request and Response that is simply transient storage that only lives during each message, and is discarded alongside the message itself, when the message finishes.
This is definitely a Template6 issue if I'm comprehending this correctly. And using the stash won't actually change anything. T6 isn't in a great state IMO, I would strongly recommend using Mustache instead.
Just to be super clear, you make the post request, then the get request and the get request has the post value still set in the template?
Thanks for the response (pun absolutely intended). I actually popped in to reply to your first one to say the same: I think this is a Template6 problem and I probably should've just used Mustache as I saw in your examples. I went with Template6 because I had some familiarity with TT but I hit another bug after trying to pass my $response.stash
hash to the template.
My time would've been better spent figuring out Mustache!
Just to be super clear, you make the post request, then the get request and the get request has the post value still set in the template?
That is correct. I tested from two different clients and one can see the value from the other. Thought I was losing it.
@swaggboi I'm going to close this as complete, please re-open it if you think think this was improperly closed. Thanks!
Hello I'm trying to populate a template with something that the user submits in a POST body:
The template can just be:
The problem I'm having is that 'output-value' lives on until someone submits another. I expected it to just exist for that one request/response transaction. I see there's a 'stash' in the Middleware class; is this something I can or should use to pass this value to the template and then be 'forgotten' after the transaction?