Ajax post returns null




















This is an issue for my API, because wrapping null in quotes makes it become treated as a string literal "null" which is interpreted differently than the object literal null. If you send data as plain JSON then it will bypass null as it is. Thank you for responding nolimits4web. I wish to remain cordial while stating that what you are saying is incorrect. These are in fact two unequivalent literals.

I have submitted issue on github with a recommendation for how to resolve this issue in the request. By the way, your code is incredibly clear and easy to read. I am grateful for this. Find centralized, trusted content and collaborate around the technologies you use most. Connect and share knowledge within a single location that is structured and easy to search. I tried not to post "aracid" with "kisi" so ajax posted well for one parameter "kisi", but doesnt work together If you serializing the form, then you can add additional values to it with the.

MVC will map the object for you, so you might as well skip the extract nesting of the form within the object. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 6 years, 4 months ago. Active 6 years, 4 months ago. Viewed times. I have been trying to post two parameteres AracID; console.

Improve this question. Seems weird that you are serializing an entire form into one variable. Did you look to see what is being sent up in the Ajax request in the network tab of the console? Is there a particular reason you chose the later of two near-identical answers and only chose to comment on the other one? Add a comment. Active Oldest Votes. Action "Save","AracKirala" ', data: data, Improve this answer. I mean add aracid property to model?



0コメント

  • 1000 / 1000