Was this page helpful?

Web.Json

    Table of contents
    1. 1. Usage Restrictions
    2. 2. Parameters
    3. 3. Result
    4. 4. Samples
    web.Json(source : str, ttl: num) : any
    

    Parse JSON source into a DekiScript data-structure.

    Usage Restrictions

    8.08 or later.

    Parameters

    Name Type Description
    source str source text or source URI
    ttl num (optional, range: 60 - 86400, default: 300) caching durations in seconds

    Result

    If the source argument is not a URI, web.json works the same as json.parse.  Otherwise, web.json fetches the data from the URI using web.text and parses it using json.parse.

    NOTE: all web.* functions are limited to reading at most 500KB of data from a URI.

    Samples

      Output

    To convert JSON into a DekiScript data-structure:

    {{ web.json("{ hello: 'world' }") }} 

    { hello : "world" }

    To fetch JSON from a URI and convert it into a DekiScript data-structure:

    {{ web.json("http://api.crunchbase.com/v/1/company/twitter.js") }}

    ")" expected: string.deserialize(value), line 1, column 9 (click for details)

     

     

    Was this page helpful?
    Tag page
    Viewing 2 of 2 comments: view all
    @SteveB
    Is the dekiscript data structure mentioned is XHTML, XML, etc? If I have some json data from a ning site that I want to POST (http://developer.mindtouch.com/en/ref/MindTouch_API/POST:pages//%7Bpageid%7D//contents) to pages in MindTouch, does that mean I have to go through the conversion to dekiscript data structure first?

    Any pointers on how you'd approach this? Can desktop suite help?

    Cheers, Nathan
    Posted 16:14, 20 Jul 2010
    @travellingwithoutmoving you may want to move this discussion to the forums instead
    Posted 16:22, 20 Jul 2010
    Viewing 2 of 2 comments: view all
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by