Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 23, 2012 04:28 AM by alexbeloff
0 Points
6 Posts
Nov 22, 2012 06:55 PM|LINK
It's probably simple but I don't get it...
I've got the following json sent from the client:
{"language":"en-us","name":"project","committees":[{"name":"comm 1","selected":true}]}
And I want to get this in my web api method as a Jobject (or Jtoken). I do receive it but there's no properties. So I can't get only language value for example.
What am I missing here?
Nov 23, 2012 04:28 AM|LINK
ok, found it! When using $.ajax you must specify content type:
contentType: "application/json"
alexbeloff
0 Points
6 Posts
Get JSON as web api method parameter
Nov 22, 2012 06:55 PM|LINK
It's probably simple but I don't get it...
I've got the following json sent from the client:
{"language":"en-us","name":"project","committees":[{"name":"comm 1","selected":true}]}And I want to get this in my web api method as a Jobject (or Jtoken). I do receive it but there's no properties. So I can't get only language value for example.
What am I missing here?
alexbeloff
0 Points
6 Posts
Re: Get JSON as web api method parameter
Nov 23, 2012 04:28 AM|LINK
ok, found it! When using $.ajax you must specify content type: