Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81689

POST json data

$
0
0
I'm trying to use ASP.Net web services for the data source. The problem I'm having is that my web services expect the data in JSON format. But the only way I can use your methods to post is in query string format. So, instead of my post looking like this:
{"wsParameter": { "ID": 1001, "Name": "Some Guy", "Address": "123 Main St" } }

It looks like this
wsParameter=%7B%22ID%22%3A%221001%22%2C%22Name%22%3A%22Some%20Guy%22%2C%22Address%22%3A%22123%20Main%20St%22%3A%7D%7D

Does anyone have a workaround to get this to post JSON format?

(PS: I had to modify the script a little because you have to pass a content type header "contentType": "application/json; charset=utf-8" to $.ajax for ASP.Net web services to work at all. But so far, I can only figure out post calls without data.)

Viewing all articles
Browse latest Browse all 81689

Trending Articles



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