Delete try catch from ReconClient.

This commit is contained in:
sunwen
2023-08-22 10:47:19 +08:00
parent 24399db391
commit e47b1c9602
6 changed files with 70 additions and 14 deletions

View File

@@ -15,9 +15,10 @@ namespace Req {
Request &operator=(Request &&) = delete;
Request &operator=(const Request &) = delete;
~Request();
bool isValid();
void setClientCertificate(const std::string &cerPath, const std::string &keyPath);
void setVerbose(bool verbose);
Response post(const std::string& url, const std::string &body = std::string(),
Response* post(const std::string& url, const std::string &body = std::string(),
const std::unordered_map<std::string, std::string>& headers =
std::unordered_map<std::string, std::string>());
@@ -27,6 +28,8 @@ namespace Req {
std::string mCert;
std::string mKey;
bool mVerbose;
bool mValid;
};
}
#endif // __REQUEST_H__

View File

@@ -7,6 +7,7 @@ namespace Req {
{
public:
Response();
static Response* ErrorResponse(const std::string & content);
Response(Response &&) = default;
Response(const Response &) = default;
Response &operator=(Response &&) = delete;
@@ -15,9 +16,11 @@ namespace Req {
long httpCode();
void setHttpCode(long code);
std::string& getContent();
bool isResponsed();
private:
long mHttpCode = 404;
std::string mContent;
bool mResponsed;
};
};
#endif // __RESPONSE_H__