Skip to content

Instantly share code, notes, and snippets.

@fourcolors
Created April 17, 2013 17:22
Show Gist options
  • Save fourcolors/5406131 to your computer and use it in GitHub Desktop.
Save fourcolors/5406131 to your computer and use it in GitHub Desktop.
{create: ‘POST’, update: ‘PUT’, destroy: ‘DELETE’}
method = ‘create’
httpRequest = {create: ‘POST’, update: ‘PUT’, destroy: ‘DELETE’}
httpRequest[method]
method = ‘create’
httpRequest = httpRequest = {create: ‘POST’, update: ‘PUT’, destroy: ‘DELETE’}[method]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment