Set api response header in GlabalVariable

How can i set the rest api response header in global variable?

To set header response in global variable to the follow:
ResponseObject res=WS.sendRequest(findTestObject(‘your webservice location’))
def vid=res.headerFields.get(‘Your value the you want to get from header’)
GlobalVariable.vID=vid