json

Rails: How to send a json object to a other server?

Hi everybody, I'm trying to implement the in App purchase mechanism in my iPhone app. To do so I need to make a json object out of the receipt string on my rails server, and send it to a iTunes server. How can I create a json object out of a string? to_json didn't work for me... How can I send that json object to the specified Server ...

Problems loading JSON code in Python

I've been tyring to figure out how to load JSON objects in Python. I'm able to send a JSON string to the server, but there it fails. This is what I'm sending through a websocket with JavaScript: ws.send('{"test":"test"}'); The server receives it without a problem, but can't validate it: {"test":"test"} This is not a JSON object! ...

Is there a safe subset of JSON that can be used with all JSON parsers & databases

JSON is still becoming more and more important for exchange of data but the JSON specification is rather lax in some aspects: The names within an object SHOULD be unique. An implementation may set limits on the size of texts that it accepts. An implementation may set limits on the maximum depth of nesting. An implementatio...

Retrive JSON data by index

Hi, I am using PHP json_encode to generate JSON data of a shopping cart : {"6cb380f1bfbcd7728be7dfbf2be6bad4":{"rowid":"6cb380f1bfbcd7728be7dfbf2be6bad4", "id":"sku_131ABC","qty":"4","price":"35.95","name": "T-Shirt","options":{"Size":"M","Color":"Red"},"subtotal":143.8}} As you notice the initial ID is unique and not predictable. I...

json date object to php date

Hi, I am calling a webservice which return me back a json object. The json object encodes the date. I am trying to find a way to convert that date to m-d-Y format in php. Json object is {"DateOfBirth":"\/Date(387518400000-0400)\/"} this date is 02-15-1982. The webservice which I am calling is in .NET, and it converts the date to the...

jira SOAP and XMLRPC

I was wondering if there are urls for the various calls that can be made to jira. get issues, get users. what format are they in xml? json? I want to write a wrapper class in python. I see the SOAP api exsists but no methods definitions in python anywhere I can find. I found the java one fairly easy. Your help is appreciated. Please a...

Where do you sanitize JSON input in your ASP.net application?

I have an ASP.net application with a WCF service like this: [OperationContract] [WebGet] public string DoDeleteRow(GridParameter request) { ... do stuff.. } How would you validate the variable "request"? Do you simply rely on the Microsoft JSON parser and let that reconstruct the object for you, or do you just accept a string input a...

Spring's Json not being resolved with appropriate response

I've tried to have a controller in Spring return a JSON response to no avail using the Jackson classes as recommended with 3.0. I've got the jackson jar files(jackson-core-asl-1.5.5.jar & jackson-mapper-asl-1.5.5.jar) in my class path of course. As for the appconfig.xml entries, I'm not sure I need these. I've put them in there as a las...

Loading JSON values into DIVs with jQuery

Hi there. I am trying to load images from the Facebook graph api into a div on my website. I have a div for each of the albums on my facebook page, each has the url id in the rel value. I am trying to loop through the graph api urls and load the first image in each json datablock using the code below: $('.thumbnail').each(function(ind...

Facebook Graph API retrieve Friends with json and C#

I'm working in C# with the Graph API and have been able to grab Facebook user profile information such as the ID, Name and email and then deserialize the JSON to be able to assign the values to labels. However, my problem is when I go to grab the list of Friends, or list of anything for that matter, how do I go about deserializing this ...

How to solve circular reference in json serializer caused by hibernate bidirectional mapping?

I am writing a serializer to serialize POJO to JSON but stuck in circular reference problem. In hibernate bidirectional one-to-many relation, parent references child and child references back to parent and here my serializer dies. (see example code below) How to break this cycle? Can we get owner tree of an object to see whether object ...

sample code to parse data through JSON in android

I want to parse REST Webservices with the help of JSON. Plz help me by giving sample code how to parse the rest webservices xml in android through JSON ...

getJSON function always returns null

Hello all I am trying to make a get http request using jquery getJSON function. I have implemented it like this... <script type="text/javascript"> $(function(){ $("#query").keyup(function(event) { keyword = $("#query").val(); $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&amp;tagmode=any&amp;...

Storing associative array in MySQL DB

Hello, I'd like to store associative array containg mostly strings and integers as values in db. I was thinking: implode/explode - need to find delimiter, which won't be in values - since it's almost user generated, not safe XML - feels to heavy for the job (creating/reading values) json - if i need only to work with json_decode/json...

How can I extract the title and description of a TED.com video?

I have a project that I need to add many many videos, some of which are TED.com videos. Is there an easy way I can perform an AJAX, JSON, or cURL request to obtain this information? This information does not seem to be in the embed object. ...

send json object with httparty

Hi there, I'm trying to implement the in App purchase from within my iPhone app. To verify the receipt I need to send a json object to the iTunes server. Im trying to do this with the httparty plugin: require 'httparty' class ItunesVerification include HTTParty base_uri 'https://sandbox.itunes.apple.com' default_params :output =...

Struts 2: how to send JSON to action

How to send Json to action, on Struts2? ...

skipping over potential nulls c#

I have this block of code that eventually get serialized to JSON, for use in the Jquery FullCalender plugin. The ToUnixTimeSpan method taskes in a DateTime object and returns the number of seconds since 1970. DateEnd could be null. In this block of code how do i test for the null and skip the end = ToUnixTimespan(e.DateEnd), if Dat...

Compare multiple values in a Ruby array

[ { "name": "John Doe", "location": { "name": "New York, New York", "id": 12746342329 }, "hometown": { "name": "Brooklyn, New York", "id": 43453644 } }, { "name": "Jane Doe", "location": { "name": "Miami, Florid...

Django: Parse JSON in my template using Javascript

Hello, I have this in my view: string_location = myaddress2 geodata = [] for place, (lat, lng) in g.geocode(string_location,exactly_one=False): geodata.append((place, (lat, lng))) geodata_results = len(geodata) data = {"geodata": geodata, "geodata_results":geodata_results } return render_to_response("busin...