Created
November 18, 2015 07:01
-
-
Save mpneuried/065dad78d692fc28c641 to your computer and use it in GitHub Desktop.
jQuery: How to post with a json body
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
_data = | |
foo: 23 | |
bar: 42 | |
bazz: null | |
$.ajax | |
url: _path | |
type: "POST" | |
data: JSON.stringify( _data ) | |
contentType: "application/json; charset=utf-8" | |
dataType: "json" | |
success: ( model ) => | |
# todo | |
return | |
error: -> | |
# todo | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment