asp.net mvc - Form posting JSON data which includes a url is being split at the query string of the url -
i need post json data mvc controller contains url's. json data looks it's being split @ query string (=)
the json data looks this:
"{"files":[{"title":"test","originalfilename":"", "filename":"http://company.domain.com/auth.aspx?enrollmentkey=apk54cd1546a8454d4ca79ded89a78f8698", "categories":[{"categoryid":76,"subcategoryid":182,"catid":"catid0"}], "typeid":"84", "tags":["select tag(s)..."], "tagids":[], "roles":[], "memberonly":false, "contenttypeid":7, "id":0, "ispublished":true, "publishdate":""}]}" debugging, see it's being split
key (request.form.getkey(0)):
{"files":[{"title":"test","originalfilename":"","filename":"http://company.domain.com/auth.aspx?enrollmentkey value (request.form.getvalue(0)):
apk54cd1546a8454d4ca79ded89a78f8698","categories":[{"categoryid":110,"subcategoryid":111,"catid":"catid0"}],"typeid":"69","tags":["select tag(s)..."],"tagids":[],"roles":[],"memberonly":false,"contenttypeid":7,"id":0,"ispublished":true,"publishdate":""}]} does json data needs escaped @ = or whole thing needs encoded or missing something?
i should note i'm using knockout's ko.tojson(js) create json although i'm not sure relevant.
i noticed chrome dev tools seems recognize key-val split:

if sending json data server, content-type header needs set application/json. if set application/x-www-form-urlencoded server try interpret json key-value pairs in url. why json string getting broken in 2 @ =.
Comments
Post a Comment