All Questions

710
votes
21answers
463143 views

Deserialize JSON into C# dynamic object?

Is there a way to deserialize JSON content into a C# 4 dynamic type? It would be nice to skip creating a bunch of classes in order to use the DataContractJsonSerializer.
8680
votes
33answers
2006536 views

What is the correct JSON content type?

I've been messing around with JSON for some time, just pushing it out as text and it hasn't hurt anybody (that I know of), but I'd like to start doing things properly. I have seen so many purported "...
274
votes
10answers
691184 views

How can I parse JSON with C#?

I have the following code var user = (Dictionary<string, object>)serializer.DeserializeObject(responsecontent); The input in responsecontent is JSON, but it is not properly parsed into a JSON...
1023
votes
20answers
1010511 views

Safely turning a JSON string into an object

Given a string of JSON data, how can you safely turn that string into a JavaScript object? Obviously you can do this unsafely with something like... var obj = eval("(" + json + ')'); ...but that l...
29
votes
5answers
29074 views

Serialize and Deserialize Json and Json Array in Unity

I have a list of items send from a PHP file to unity using WWW. The WWW.text looks like [{"playerId":"1","playerLoc":"Powai"},{"playerId":"2","playerLoc":"Andheri"},{"playerId":"3","playerLoc":"Church...
1714
votes
36answers
641019 views

How do I format a Microsoft JSON date?

I'm taking my first crack at Ajax with jQuery. I'm getting my data onto my page, but I'm having some trouble with the JSON data that is returned for Date data types. Basically, I'm getting a string ba...
1111
votes
11answers
792061 views

Serializing to JSON in jQuery

I need to serialize an object to JSON. I'm using jQuery. Is there a "standard" way to do this? My specific situation: I have an array defined as shown below: var countries = new Array(); countries[0...
212
votes
11answers
177919 views

Converting JSON to Java

I want to be able to access properties from a JSON string within my Java action method. The string is available by simply saying myJsonString = object.getJson(). Below is an example of what the string...
445
votes
31answers
502140 views

Parsing JSON with Unix tools

I'm trying to parse JSON returned from a curl request, like so: curl 'http://twitter.com/users/username.json' | sed -e 's/[{}]/''/g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n;...
902
votes
7answers
1615646 views

Parsing values from a JSON file?

I have this JSON in a file: { "maps": [ { "id": "blabla", "iscategorical": "0" }, { "id": "blabla", "iscategorical": "0" ...

Previous Next