diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2016-05-04 09:44:35 +0000 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2016-05-04 09:44:35 +0000 |
commit | 493305a0d4e9d7f9bdc35fabfd8027a487586e47 (patch) | |
tree | ec05c1bde5b5cfb7937de6f06dc3586f26f557f9 /src/include/gnunet_jsonapi_lib.h | |
parent | 8e9bb50b7543608c2c1a833a5b92f19941ed7a0a (diff) | |
download | gnunet-493305a0d4e9d7f9bdc35fabfd8027a487586e47.tar.gz gnunet-493305a0d4e9d7f9bdc35fabfd8027a487586e47.zip |
- rework rest/jsonapi API; bugfixes
Diffstat (limited to 'src/include/gnunet_jsonapi_lib.h')
-rw-r--r-- | src/include/gnunet_jsonapi_lib.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/include/gnunet_jsonapi_lib.h b/src/include/gnunet_jsonapi_lib.h index 1e540f6b6..d4556c174 100644 --- a/src/include/gnunet_jsonapi_lib.h +++ b/src/include/gnunet_jsonapi_lib.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #define GNUNET_JSONAPI_LIB_H | 22 | #define GNUNET_JSONAPI_LIB_H |
23 | 23 | ||
24 | #include "gnunet_util_lib.h" | 24 | #include "gnunet_util_lib.h" |
25 | #include "gnunet_rest_lib.h" | ||
25 | #include "gnunet_json_lib.h" | 26 | #include "gnunet_json_lib.h" |
26 | 27 | ||
27 | 28 | ||
@@ -200,5 +201,41 @@ GNUNET_JSONAPI_data_serialize (const struct GNUNET_JSONAPI_Object *resp, | |||
200 | */ | 201 | */ |
201 | json_t* | 202 | json_t* |
202 | GNUNET_JSONAPI_resource_get_id (const struct GNUNET_JSONAPI_Resource *resource); | 203 | GNUNET_JSONAPI_resource_get_id (const struct GNUNET_JSONAPI_Resource *resource); |
204 | |||
205 | |||
203 | /* end of gnunet_jsonapi_lib.h */ | 206 | /* end of gnunet_jsonapi_lib.h */ |
207 | |||
208 | /** | ||
209 | * Check rest request for validity | ||
210 | * | ||
211 | * @param req handle to the request | ||
212 | * @return GNUNET_OK if valid | ||
213 | */ | ||
214 | int | ||
215 | GNUNET_JSONAPI_check_request_acceptable (struct GNUNET_REST_RequestHandle *req); | ||
216 | |||
217 | /** | ||
218 | * Check rest request for validity | ||
219 | * | ||
220 | * @param req handle to the request | ||
221 | * @return GNUNET_OK if valid | ||
222 | */ | ||
223 | int | ||
224 | GNUNET_JSONAPI_check_request_supported (struct GNUNET_REST_RequestHandle *req); | ||
225 | |||
226 | |||
227 | /** | ||
228 | * Handle jsonapi rest request. Checks request headers for jsonapi compliance | ||
229 | * | ||
230 | * @param req rest request handle | ||
231 | * @param handler rest request handlers | ||
232 | * @param cls closure | ||
233 | * @return GNUNET_OK if successful | ||
234 | */ | ||
235 | int | ||
236 | GNUNET_JSONAPI_handle_request (struct GNUNET_REST_RequestHandle *req, | ||
237 | const struct GNUNET_REST_RequestHandler *handlers, | ||
238 | struct GNUNET_REST_RequestHandlerError *err, | ||
239 | void *cls); | ||
240 | |||
204 | #endif | 241 | #endif |