2 This file is part of GNUnet
3 Copyright (C) 2014, 2015, 2016 GNUnet e.V.
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 * @file gnunet_jsonapi_util.h
20 * @brief utility functions for jsonapi
21 * @author Martin Schanzenbach
23 #ifndef GNUNET_JSONAPI_UTIL_H
24 #define GNUNET_JSONAPI_UTIL_H
26 #include "gnunet_util_lib.h"
27 #include "gnunet_rest_lib.h"
28 #include "gnunet_jsonapi_lib.h"
32 * Check rest request for validity
34 * @param req handle to the request
35 * @return GNUNET_OK if valid
38 GNUNET_JSONAPI_check_request_acceptable (struct GNUNET_REST_RequestHandle *req);
41 * Check rest request for validity
43 * @param req handle to the request
44 * @return GNUNET_OK if valid
47 GNUNET_JSONAPI_check_request_supported (struct GNUNET_REST_RequestHandle *req);
51 * Handle jsonapi rest request. Checks request headers for jsonapi compliance
53 * @param req rest request handle
54 * @param handler rest request handlers
56 * @return GNUNET_OK if successful
59 GNUNET_JSONAPI_handle_request (struct GNUNET_REST_RequestHandle *req,
60 const struct GNUNET_REST_RequestHandler *handlers,
61 struct GNUNET_REST_RequestHandlerError *err,