jquery - POST request reaches server but empty -
i'm setting api simple webservice , stumbled upon problem. use ruby on rails end , jquery ajax call send post create instance of model. javascript code is:
$.ajax({ type: "post", url: "http://localhost:3000/api/v1/person/add", data: "name=john&location=boston", success: function(msg){ alert( "data saved: " + msg ); } });
when execute server request type of option, think first call of 2 needed complete post request(?) because these sites not on same domain (since calls gonna made remotely) fails. main problem request not contain data @ in body. guess first call not sending data waits sort of 'ok' able send data?? if not, why empty? don't want use request since says in guidelines of restful api should use post purpose, plus might want send more data can handle. in case assumptions correct , post request fails because of cross-domain calls, options?
edit: see you're trying cross-domain ajax queries... that's non-starter. see here additional info (just searched cross domain , picked one): ajax cross domain call
Comments
Post a Comment