mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 20:03:34 -03:00
fff771ee86
URLs may contain a query string (prefixed with '?') and this should be ignored when parsing the data format. To facilitate testing this functionality, ParseDataFormat has been made non-static.
28 lines
786 B
C++
28 lines
786 B
C++
// 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>
|
|
|
|
enum class RESTResponseFormat {
|
|
UNDEF,
|
|
BINARY,
|
|
HEX,
|
|
JSON,
|
|
};
|
|
|
|
/**
|
|
* 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.
|
|
*/
|
|
RESTResponseFormat ParseDataFormat(std::string& param, const std::string& strReq);
|
|
|
|
#endif // BITCOIN_REST_H
|