+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * InspIRCd: (C) 2002-2008 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
#include "base.h"
#ifndef HTTPCLIENT_H__
const char* HTTP_CLIENT_RESPONSE = "HTTPCLIENT_RESPONSE";
const char* HTTP_CLIENT_REQUEST = "HTTPCLIENT_REQUEST";
+const char* HTTP_CLIENT_ERROR = "HTTPCLIENT_ERROR";
/** This class represents an outgoing HTTP request
*/
}
};
+class HTTPClientError : public Request
+{
+ protected:
+ friend class HTTPSocket;
+ std::string url;
+ int response;
+ std::string responsestr;
+ HeaderMap Headers;
+ public:
+ HTTPClientError(Module* src, Module* target, const std::string &url, int response)
+ : Request(src, target, HTTP_CLIENT_ERROR), url(url), response(response)
+ {
+ }
+
+ const std::string &GetURL()
+ {
+ return url;
+ }
+};
+
class HTTPClientResponse : public Request
{
protected:
str = responsestr;
return response;
}
+
+ void SetResponse(const std::string &str)
+ {
+ responsestr = str;
+ response = atoi(responsestr.c_str());
+ }
std::string GetHeader(const std::string &header)
{