On 13/01/2009, at 4:32 AM, mk wrote:

>
> Jonathan Vanasco wrote:
>> The Original Poster was not talking about a WEB API for REST/JSON, he
>> said Command Line API
>
> Well I'm the OP here. :-) Anyway, if I understand correctly, Chris
> suggested outputting JSON to a scripting client, which would work  
> like this:
>
> - scripting client calls normal URIs in the web app over http, but  
> would
> set "Accept: application/json" header in the request.
>
> - web app understands that if above header is set, it should output
> JSON, which is then parsed by the client's JSON reader.
>
> IOW, if I understand correctly, Chris suggested that scripting  
> library /
> commandline tool should be a thin wrapper around code producing HTTP
> requests and parsing JSON replies (right?).

That's what I was suggesting yes.  With the assumption that your  
clients would be remote (separate servers/networks).

If what you want is a command-line tool to work directly with your  
application's model, then I would write a separate script that imports  
the model and works with it directly.  You could even factor out the  
model as a separate package that both applications (Pylons app &  
command-line tool) depend on, which is what I commonly do.

Cheers,
Chris Miles


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to