2022-01-27 21:20:05 +00:00
|
|
|
// Copyright (c) 2015-2022 The Bitcoin Core developers
|
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
#ifndef BITCOIN_REST_H
|
|
|
|
#define BITCOIN_REST_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2022-01-27 21:31:35 +00:00
|
|
|
enum class RESTResponseFormat {
|
2022-01-27 21:20:05 +00:00
|
|
|
UNDEF,
|
|
|
|
BINARY,
|
|
|
|
HEX,
|
|
|
|
JSON,
|
|
|
|
};
|
|
|
|
|
2022-01-18 16:37:54 +00:00
|
|
|
/**
|
|
|
|
* Parse a URI to get the data format and URI without data format
|
|
|
|
* and query string.
|
|
|
|
*
|
|
|
|
* @param[out] param The strReq without the data format string and
|
|
|
|
* without the query string (if any).
|
|
|
|
* @param[in] strReq The URI to be parsed.
|
|
|
|
* @return RESTResponseFormat that was parsed from the URI.
|
|
|
|
*/
|
2022-01-27 21:31:35 +00:00
|
|
|
RESTResponseFormat ParseDataFormat(std::string& param, const std::string& strReq);
|
2022-01-27 21:20:05 +00:00
|
|
|
|
|
|
|
#endif // BITCOIN_REST_H
|