mpneuried
11/18/2015 - 7:01 AM

jQuery: How to post with a json body

jQuery: How to post with a json body

_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