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 under the
6 terms of the GNU General Public License as published by the Free Software
7 Foundation; either version 3, or (at your option) any later version.
9 GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License along with
14 GNUnet; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/>
17 * @file gnunet_jsonapi_util.h
18 * @brief utility functions for jsonapi
19 * @author Martin Schanzenbach
21 #ifndef GNUNET_JSONAPI_UTIL_H
22 #define GNUNET_JSONAPI_UTIL_H
24 #include "gnunet_util_lib.h"
25 #include "gnunet_rest_lib.h"
26 #include "gnunet_jsonapi_lib.h"
30 * Check rest request for validity
32 * @param req handle to the request
33 * @return GNUNET_OK if valid
36 GNUNET_JSONAPI_check_request_acceptable (struct GNUNET_REST_RequestHandle *req);
39 * Check rest request for validity
41 * @param req handle to the request
42 * @return GNUNET_OK if valid
45 GNUNET_JSONAPI_check_request_supported (struct GNUNET_REST_RequestHandle *req);
49 * Handle jsonapi rest request. Checks request headers for jsonapi compliance
51 * @param req rest request handle
52 * @param handler rest request handlers
54 * @return GNUNET_OK if successful
57 GNUNET_JSONAPI_handle_request (struct GNUNET_REST_RequestHandle *req,
58 const struct GNUNET_REST_RequestHandler *handlers,
59 struct GNUNET_REST_RequestHandlerError *err,