I'd like to parse a JSON string into an object under Google App Engine (python). What do you recommend? Something to encode/stringify would be nice too. Is what you recommend built in, or a library that I have to include in my app? Is it secure? Thanks.
...
I've got this JSON coming back like this:
{"responseData": {"results":[{"GsearchResultClass":"GwebSearch","unescapedUrl":"http://www.hellomagazine.com/","url":"http://www.hellomagazine.com/","visibleUrl":"www.hellomagazine.com","cacheUrl":"http://www.google.com/search?q\u003dcache:QzMhUCC4zBoJ:www.hellomagazine.com","title":"\u003cb\u00...
SerializeJSON creates JSON with non printable characters (i.e. ASCII 21)
This is invalid JSON. How can I get round this.
Would a regex removing the non printable characters work?
What regex would remove non printable characters?
...
I have a struct in C# that wraps a guid. I'm using DataContractJsonSerializer to serialize an object containing an instance of that class. When I was using a guid directly, it was serialized as a plain string, but now it's serialized as a name/value pair. Here's an NUnit test and supporting code that demonstrates the problem:
privat...
I have a web service returning JSON, but now I'd like to modify it to allow callers to specify a callback function so the return goes from: JSON DATA to specifiedFunction(JSON DATA); The way I'm returning JSON right now is just by returning an instance of an object and having .NET do its serialization magic, if I change to just returning...
I need a JSON, JS Array parser in Java and/or PHP. Do you know any parser ?
regards,
...
I have a class that's currently inheriting from Dictionary and then adds a few first class member properties to it. Roughly:
public class Foo : Dictionary<string, string>
{
public string Bar { get; set; }
public string Baz { get; set; }
}
Upon serializing an instance of this object to JSON however, it appears that the serialize...
Can I return a Json result that contains also a rendered view?
I need it to return the new ID of a submitted form along with its HTML and some other properties.
Also that can be helpful when I need to return two (or more) view results from one action inside a Json object.
Thanks!
...
I need to find out if an id occurs in my JSON object, for example:
{
"requested": "2009-07-25T14:12:25+01:00",
"channels": [
{"id": 1, "name": "General", "created": "2009-07-25 14:00:02"}
]
}
Specifically I need to check if my id (say, 2) occurs in channels.i.id. How can this be done?
...
I am new to JSON and trying to recover some text from a JSON variable.
The JSON variable is sent from a Javascript File and has this structure:
foo({
"query": {
"count": "2",
"created": "2009-07-25T08:17:54Z",
"lang": "en-US",
},
"results": {
"result": [
{
"abstract": "<b>Pizza</b> Hut®. Order Online for Deliver...
I still haven't really used JSON in a real world project - I pretty much always rely on XML.
...
How do I serialize all elements of my form to a JSON object?
I'd like to have some way of automatically building a JSON object from my form, without having to loop over each element. I do not want a string, as returned by $('#formid').serialize();, nor do I want the map returned by $('#formid').serializeArray();
...
Hi, I want to get a subset of a string in Javascript. Currently, I only know how to store the entire string:
I have this as a JSON variable with a callback to foo:
foo({"results":[
"<div id=\"following\"><span><a href=\"http://twitter.com/barackobama\">Obama</a></span></div>"
]})
And this is my callback function:...
Not really sure why I'm getting the exception.. the code is sound and the API is working through my browser.
var url = new Uri("http://octopart.com/api/search?keywords=" + topic.Text);
WebClient octopartCall = new WebClient();
octopartCall.OpenReadCompleted += new OpenReadCompletedEventHandler(Octopart_Completed);
...
Hey there.
This may already have an answer here but I can't seem to find the right search string so..
I have, almost the same as the comments in SO, a page that has many instances of the same PartialView.
The partial view has a button in it that when pressed adds a comment associated to the product the PartialView represents.
I can e...
Hello,
The background is that I've got a celery distributed job server configured with a Django view that returns the status of a running job in JSON. The job server is located at celeryserver.mydomain.com and the page I'm executing the jQuery from is www.mydomain.com so I shouldn't need to consider JSONP for this should I, as the req...
Does anyone know of a robust, (and bullet proof) is_JSON function snippet for PHP? I (obviously) have a situation where I need to know if a string is JSON or not.
Hmm, perhaps run it through a JSONLint, but that seems a bit overkill.
...
I am finding many "solutions" to this seemingly common problem, but alas, none seem to work for me - of course. I have some jQuery code that is trying to post to an ASP.NET 3.5 web service. The web service is supposed to return some json. I am getting 501 Internal Server errors with the code below, but according to the solutions found...
I'm going to re-ask this question in a slightly different way.
Say I have 2 or more of the [same] partial view on the page.
On this PartialView there is a text box and a button.
On the click of the button I need to take the contents of the textbox and do a Json postback, do some stuff and return a result set.
The problem I have is th...
We've written a .NET wrapper API for a set of web services. All this does is make requests and return JSON data. What's a good way to build a test framework for this? I can't think of how to do unit tests since I'd have to know the expected JSON string I'm getting back and that's very dynamic and complex. I thought of doing a WebTest but...