Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

aspnet 5 ajax post

$
0
0

hi,

i'm currently playing with using my own ajax to send some stuff to a controller action similar to the way i did in mvc 5, but iv noticed without the content-type being set to "application/x-www-form-urlencoded; charset=UTF-8" i do not get any variables received as they are all blank otherwise, does anyone know why this is?

i was originally using:-

contentType: 'application/json; charset=utf-8',

data: JSON.stringify(postData)

but now it only seems to work with:-

contentType: 'application/x-www-form-urlencoded; charset=UTF-8',

data: postData


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>