json

Post binary data to a RESTful application

Hi, I'm working on a RESTful web application (Django+Piston). The POST request sends data encoded with Json to the web application. This works fine for all my text only database tables but I also have a table which stores text and binary files. What is the best way to post text and binary data to a RESTful application? ...

why JavaScript is not displaying parsed json data?

This is format of JSON data: [{"options":"smart_exp"},{"options":"user_int"},{"options":"blahblah"}] that I receive through getjson from server. I need to append json with user input. I am trying to do it in this way: 1st convert it into javascript object, append it with user input, again convert to json object & send it back to server f...

JSON date to Java date?

I could not find this anywhere. I fetch some JSON from an API that returns standard JSON dates. You can see the format by running this code in a JavaScript console: > new Date().toJSON(); "2010-10-27T11:58:22.973Z" Well, actually, the API I'm working with is not returning the millisecond part, and sometimes it returns a timezone inste...

Listing out JSON data?

How do i display the values that JSON returns? function akaiphoneResponse(searchText){ $.ajax({ type: "GET", url: Drupal.settings.basePath + 'akaiphone/response', data: 'search_text=' + searchText, success: function(data) { $("#search-results", this).empty(); var jsob = jQuery.pa...

Add exception message to json response

Hello, I have a code which throws a specific type of exception like this: throw new BadDataException("error message"); these kind of exceptions are thrown inside a method whose response type is json. I have a configuration for this exception type like this: <global-exception-mappings> <exception-mapping result="badDataError" e...

Handling lazy JSON in Python - 'Expecting property name'

Using Pythons (2.7) 'json' module I'm looking to process various JSON feeds. Unfortunately some of these feeds do not conform with JSON standards - in specific some keys are not wrapped in double speech-marks ("). This is causing Python to bug out. Before writing an ugly-as-hell piece of code to parse and repair the incoming data, I tho...

Structure of php JSON output

this is continued from another question i asked: http://stackoverflow.com/questions/4033116/listing-out-json-data my search only returns 1 item, im pretty sure the problem lies somewhere in my php, im not too sure if im adding to the array properly, or it could be the javascript wich you can see on the above link, but i doubt it. my ph...

JSON Javascript highlighting in Visual Studio 2010

Does anybody know how to get VS 2010 to use the same highlighting for a file called .JSON as it uses for a JavaScript file? Just working on a client site and they've named all their JSON template files as .JSON, with the result that I just get a plain old text editor when I open it in Visual Studio. Any suggestions? I'm sure there must b...

Serialize inputs in table rows (jQuery)

I have a table with multiple rows which contain form inputs (checkboxes, text, dropdowns). When I click save I want to be able to get JSON representing each table row which will be used in an AJAX request. Each row has an id on it so I would like to get back something like this: [1: { "input_name":"input_value", "input_name":"input_valu...

Python: Parsing JSON String List for Each JSON Object

I use the json module and the dumps method to obtain a string which represents a list of json objects : import json jsonstring = json.dumps(data) I would like to iterate over this string to obtain each JSON object as a string. Any suggestions? Thanks in advance. P.S. I have tried the following: for jsonobject in jsonstring: p...

How do I provide the following json output using java

I am trying to generate the following json output using the java net.sf.json libs but have been unsuccessful. [ { "data": [ [ 1, 1, "Text" ], [ 2, 2, "Text" ], [ ...

Parse Json in php

Does anyone how to display in php the weather by date? This is what I tried Nothing yet with: <?php $url="http://www.worldweatheronline.com/feed/weather.ashx?q=schruns,austria&amp;format=json&amp;num_of_days=5&amp;key=8f2d1ea151085304102710"; $json = file_get_contents($url); $data = json_decode($json, TRUE); echo $data[0]->weather...

C#: Deserializing JSON primitives into .NET complex types

I have a file named config.json. Here's its contents: { dataSources: [ "http://www.blahblah.com/blah", "http://www.blahblah.com/blah2", ... ], skills: [ { "name": "foobaris", "regex": "pattern" }, ... ] } I want to create a Config object o...

How can i parse Json with jquery

I need to parse a simple json response (from my rails app): [ { "photo": { "updated_at":"2010-10-14T19:12:35Z", "photo_file_size":206422, "created_at":"2010-10-14T19:12:01Z" } }, { "photo": { "updated_at":"...

How can I parse a longer JSON file than a NSString ?

Hi ! I'm a bit stuck in a project. I was writing some code to get a JSON file and store it in an NSString before parsing it into a NSArray. But I get an error: 2010-10-27 20:59:44.813 GeraldKervyn[21752:207] -JSONValue failed. Error trace is: ( "Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \"Unrecognised leading chara...

Using JSON to ask Google Maps for a Shop

Hi to all. I am using the JSON iPhone framework v2.3.1, and I want to query Google Maps about shops, hotels, etc. It is possible to create an URL direction that gives me a list of directions? Actually I am using this Objective C code. - (void) searchCoordinatesForAddress { //Build the string to Query Google Maps. //I don't kn...

Grails with JAX-RS vs UrlMappings for RESTful Services

I started out looking at the JAX-RS plugin for grails and thought that was the way to go mainly because it was based on JSR-311 and I figure following standards is usually the smart thing to do. However, using Grail's UrlMappings it seems I basically achieve the same thing. I figure I'm missing something, however, we aren't doing anyth...

How to use the YAJL for objective c

Hi can any one tell the steps to use the YAJL to parse the json object in objective c Thanks.. ...

Moving object graph between a new iPhone app and a new Rails 3 backend

I know this question has been answered a million times over the years... but times, and technologies, change quickly...so looking for "fresh" data ;-) I'm seeking advice on a robust, and relatively straight forward, approach toward moving fairly complex objects from a Rails 3 back-end to an iPhone 3(4) app. There is no pre-existing API ...

Call to undefined function Zend_Json_Expr() ?

I need to JSONize some data without quotes around the values for Javascript purposes. I am following examples like $data = array( 'onClick' => new Zend_Json_Expr('function() {' . 'alert("I am a valid javascript callback ' . 'created by Zend_Json"); }'), 'other' => 'no expression', ); $jsonObjectWithE...