2013-01-22T16:57:03.854ZJanuary 22, 2013 16:57
This is nothing to do with Groovy. You are sourcing the resource "httpRequest:/header/foo"
- so this is an ROC request which then depends on how your architecture is resolving
and providing this resource.
This is the sort of thing that the visualizer was designed for and will show you straight
away - just turn it on and do the two requests. Then take a look at the difference
between the two requests to see why the first one is getting a null.
I have the following code in a groovy script. I'm noticing that the first time I make
a request to this script the value is null even though I'm passing in the header,
but on subsequent requests it properly detects the header. I also notice that if I
change the groovy script and re-save it then it will again get a null value until
I submit the request a second time and I see the value on the subsequent request.
def fooValue = context.source("httpRequest:/header/foo", String.class);