javaConductor / gserv

GServ: Framework for SPAs and REST based services.
MIT License
49 stars 9 forks source link

Need better way to read/write headers #20

Closed javaConductor closed 9 years ago

javaConductor commented 9 years ago

Request

def userAgent = requestHeader("User-Agent") def acceptList = requestHeaders("Accept")

Response

responseHeader "Content-Type", "plain/text" responseHeaders "Content-Type", ["plain/text"] def contentType = responseHeader("Content-Type")

javaConductor commented 9 years ago

Also add accepts(String mime) which returns true if 'mime' is a value of the responseHeader 'Accepts'

javaConductor commented 9 years ago

done.