ZaStoGram_desktop/Telegram/SourceFiles/gram/api/gram_api_request.h
John Preston 817f002d42 Shrink td_gram to its Telegram-native residue
Task: 2026/08/24/shrink-td-gram-to-telegram-native-residue
2026-10-08 22:23:53 +04:00

40 lines
760 B
C++

/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "base/basic_types.h"
#include <QtCore/QByteArray>
#include <QtCore/QString>
#include <optional>
namespace Gram {
struct HttpRequest {
bool post = false;
QString endpoint;
QString query;
QByteArray payload;
};
struct ApiError {
int code = 0;
QString message;
};
[[nodiscard]] std::optional<ApiError> ParseApiError(
const QByteArray &json);
} // namespace Gram
namespace Gram::ApiDetails {
[[nodiscard]] QString PercentEncoded(const QString &value);
} // namespace Gram::ApiDetails