Mercurial > hg > orthanc
diff Resources/Samples/Plugins/Basic/Plugin.c @ 897:bafc9d592632 plugins
REST callbacks are working
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 17 Jun 2014 17:43:39 +0200 |
parents | c4053ac5db04 |
children | 7000fc86fe62 |
line wrap: on
line diff
--- a/Resources/Samples/Plugins/Basic/Plugin.c Tue Jun 17 09:57:02 2014 +0200 +++ b/Resources/Samples/Plugins/Basic/Plugin.c Tue Jun 17 17:43:39 2014 +0200 @@ -36,13 +36,26 @@ ORTHANC_PLUGINS_API int32_t Callback(OrthancPluginRestOutput* output, OrthancPluginHttpMethod method, const char* url, + const char* const* getKeys, + const char* const* getValues, + uint32_t getSize, const char* body, uint32_t bodySize) { char buffer[1024]; - sprintf(buffer, "Callback on URL [%s]\n", url); + uint32_t i; + + sprintf(buffer, "Callback on URL [%s] with body [%s]", url, body); context->LogInfo(buffer); + context->AnswerBuffer(output, buffer, strlen(buffer), "text/plain"); + + for (i = 0; i < getSize; i++) + { + sprintf(buffer, " [%s] = [%s]", getKeys[i], getValues[i]); + context->LogInfo(buffer); + } + return 1; }