Created
December 4, 2013 09:59
-
-
Save gregopet/7785091 to your computer and use it in GitHub Desktop.
Trying to figure out a Grails behaviour
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This happens with the default 2.3.3 Config.groovy: | |
//curl 'http://localhost:8080/test-accept-header/test/index' -H 'Accept: application/json, */*' | |
//FIRST BLOCK | |
//curl 'http://localhost:8080/test-accept-header/test/index' -H 'Accept: application/json' | |
//WILDCARD BLOCK | |
class TestController { | |
def index() { | |
withFormat { | |
xml { | |
render text:'FIRST BLOCK' | |
} | |
'*' { | |
render text: 'WILDCARD BLOCK' | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment