Skip to content

Instantly share code, notes, and snippets.

@nicholashagen
Created August 13, 2013 16:08
Show Gist options
  • Save nicholashagen/6222749 to your computer and use it in GitHub Desktop.
Save nicholashagen/6222749 to your computer and use it in GitHub Desktop.
API example
@Path('/:sport/:league/events')
class EventResource {
String sport
String league
@Path('/:year/:month/:day')
EventResponse getEventsForDate(Integer year, Integer month, Integer day) { ... }
@Path('/today')
EventResponse getTodaysEvents() { ... }
}
@nicholashagen
Copy link
Author

RESTful Invocation: /baseball/mlb/events/2013/06/20
Direct Invocation: new EventResource(sport: 'baseball', league: 'mlb').getEventsForDate(2013, 6, 20)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment