Mercurial > hg > orthanc
comparison Plugins/Samples/Basic/Plugin.c @ 1041:2c49b7dffcec
plugins have access to the HTTP headers
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 17 Jul 2014 14:14:15 +0200 |
parents | d06186cdc502 |
children | 8d1845feb277 |
comparison
equal
deleted
inserted
replaced
1040:d06186cdc502 | 1041:2c49b7dffcec |
---|---|
38 const OrthancPluginHttpRequest* request) | 38 const OrthancPluginHttpRequest* request) |
39 { | 39 { |
40 char buffer[1024]; | 40 char buffer[1024]; |
41 uint32_t i; | 41 uint32_t i; |
42 | 42 |
43 sprintf(buffer, "Callback on URL [%s] with body [%s]", url, request->body); | 43 sprintf(buffer, "Callback on URL [%s] with body [%s]\n", url, request->body); |
44 OrthancPluginLogInfo(context, buffer); | 44 OrthancPluginLogWarning(context, buffer); |
45 | 45 |
46 OrthancPluginAnswerBuffer(context, output, buffer, strlen(buffer), "text/plain"); | 46 OrthancPluginAnswerBuffer(context, output, buffer, strlen(buffer), "text/plain"); |
47 | 47 |
48 OrthancPluginLogWarning(context, ""); | |
49 | |
50 for (i = 0; i < request->groupsCount; i++) | |
51 { | |
52 sprintf(buffer, " REGEX GROUP %d = [%s]", i, request->groups[i]); | |
53 OrthancPluginLogWarning(context, buffer); | |
54 } | |
55 | |
56 OrthancPluginLogWarning(context, ""); | |
57 | |
48 for (i = 0; i < request->getCount; i++) | 58 for (i = 0; i < request->getCount; i++) |
49 { | 59 { |
50 sprintf(buffer, " [%s] = [%s]", request->getKeys[i], request->getValues[i]); | 60 sprintf(buffer, " GET [%s] = [%s]", request->getKeys[i], request->getValues[i]); |
51 OrthancPluginLogInfo(context, buffer); | 61 OrthancPluginLogWarning(context, buffer); |
52 } | 62 } |
53 | 63 |
54 printf("** %d\n", request->groupsCount); | 64 OrthancPluginLogWarning(context, ""); |
55 for (i = 0; i < request->groupsCount; i++) | 65 |
56 { | 66 for (i = 0; i < request->headersCount; i++) |
57 printf("** [%s]\n", request->groups[i]); | 67 { |
58 } | 68 sprintf(buffer, " HEADERS [%s] = [%s]", request->headersKeys[i], request->headersValues[i]); |
69 OrthancPluginLogWarning(context, buffer); | |
70 } | |
71 | |
72 OrthancPluginLogWarning(context, ""); | |
59 | 73 |
60 return 1; | 74 return 1; |
61 } | 75 } |
62 | 76 |
63 | 77 |