Configuration.json in filesystem our over http?

Hi!

I want to change the source of the configuration file.

I am creating a manager with friendly interface in another app.

It is possible the Orthanc access settings via http?

In OrthancInitialization.cpp, line 78,
boost::filesystem::path p = ORTHANC_PATH;

I am a noob C++ coder.
Which lib to use?
Any advice would be most welcome.

Thanks,

Vinicius

Hi Vinicius,

You could have a look at the “Orthanc::HttpClient” class that is shipped with Orthanc and that is a wrapper around libcurl and JsonCpp.

A sample code can be found in the unit tests:
https://code.google.com/p/orthanc/source/browse/UnitTestsSources/RestApi.cpp?name=Orthanc-0.7.4#18

In a nutshell, here is how to recover a JSON object from a HTTP request:

{
HttpClient c;
Json::Value v;
c.SetUrl(“http://orthanc.googlecode.com/hg/Resources/Configuration.json”);
c.Apply(v);
// The configuration file is in the “v” variable
}

HTH,
Sébastien-

Very thanks Sébastien.