I've stumbled into an API method I'm calling that's returning a serialized PHP object rather than a JSON object. Not too useful if you're calling it in python or ruby, I guess. (Or Delphi!)

I've stumbled into an API method I'm calling that's returning a serialized PHP object rather than a JSON object. Not too useful if you're calling it in python or ruby, I guess. (Or Delphi!)

I've been searching around for anything that I can use to convert it to a vanilla JSON object, with no luck.

I've found lots of references to stuff back in XE2-3 days as well as the Delphi SuperObject, but I can't figure out how to get SuperObject to do this kind of conversion directly. (I'm already using it in my app.)

Surely there's a solution somewhere

Comments

  1. Ok, I'd like one more little bit of help with SuperObject: If I've got a CSV file that looks like this:

    "hdr1,hdr2,hdr3 <-- header fields, data recs follow --v
    w1,w2,w3
    x1,x2,x3
    y1,y2,y3
    z1,z2,z3"

    How would I create a JSON object from this using SO?

    ReplyDelete
  2. David Schwartz Using SO works like this: 1. go to www.stackoverflow.com then 2. type your question then 3 get flamed.

    Seriously: you need to specify how the JSON should look like before anyone can answer this (either using SuperObject or something different).

    ReplyDelete
  3. That's what I was wondering, b/c I can see at least three different valid ways of expressing it as JSON. I found a site that helped.

    http://www.csvjson.com/csv2json

    ReplyDelete

Post a Comment