issue with headers & groovy

Poster Content
nk4um Moderator
Posts: 901
January 22, 2013 16:57

Hi Keith,

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.

Cheers,

P.

Like · Post Reply
nk4um User
Posts: 24
January 22, 2013 14:49issue with headers & groovy

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);

Like · Post Reply