I am using the latest grails (2.1.2) with rest-client-builder plugin version 1.0.3. I am trying to pass in a custom request header value (say SEC_USER) to the target server which pre-authenticates a request with this request header value. I am using the following code to pass the value in but I dont get the header value in the receiving end.
RestBuilder rest = new RestBuilder(connectTimeout:5000, readTimeout:20000);
rest.get("<some uri>") {
contentType MediaType.APPLICATION_JSON.toString()
header("SEC_USER", "foo")
}
Looking at RequestCustomizer the header() method should set the HttpHeaders field as it calls headers[name] = value
Could this be an issue in the RestTemplate class (method exchange(...)) which this plugin uses internally?