On Mon, Mar 31, 2014 at 5:28 PM, Ron Wilson <[email protected]> wrote:
> Fossil also has a JSON API, which might be easier to use for information
> requests from the Fossil repository. Information about your working space
> would still need to come either from the Fossil command line interface or
> from libfossil. But, you would need to research how to call a C library
> from Java.
>
Not necessarily - the JSON API was designed to be able to take its input
from the CLI or HTTP (because CLI is 10x easier for me to test!). So he
could call the fossil executable, pass the required flags, pipe in some
JSON data, and read the result in.
e.g.
fossil json --json-input FILENAME
is all you really need if the body of the given file contains enough
information for the request to be dispatched. Here's an example i used
during testing of the user-save features:
[stephan@host:~/cvs/fossil/fossil]$ cat j-u-save.json
{
"command": "user/save",
"payload":{
"uid":1,
"password": "x",
"name":"stephan",
"info": "http://wanderinghorse.net/home/stephan/"
}
}
The voluminous API docs can be found here:
https://docs.google.com/document/d/1fXViveNhDbiXgCuE7QDXQOKeFzf2qNUkBEgiUvoqFN4/view
feel free to post questions, suggestions, etc. e.g. i never was happy with
the 'dir' API's output and would like suggestions for how to improve it.
--
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users