9#include "MantidKernel/DllConfig.h"
23class HTTPClientSession;
26class HostNotFoundException;
40 SWITCHING_PROTOCOLS = 101,
44 NONAUTHORITATIVE = 203,
47 PARTIAL_CONTENT = 206,
48 MULTIPLE_CHOICES = 300,
49 MOVED_PERMANENTLY = 301,
55 TEMPORARY_REDIRECT = 307,
58 PAYMENT_REQUIRED = 402,
61 METHOD_NOT_ALLOWED = 405,
63 PROXY_AUTHENTICATION_REQUIRED = 407,
64 REQUEST_TIMEOUT = 408,
67 LENGTH_REQUIRED = 411,
68 PRECONDITION_FAILED = 412,
69 REQUESTENTITYTOOLARGE = 413,
70 REQUESTURITOOLONG = 414,
71 UNSUPPORTEDMEDIATYPE = 415,
72 REQUESTED_RANGE_NOT_SATISFIABLE = 416,
73 EXPECTATION_FAILED = 417,
75 INTERNAL_SERVER_ERROR = 500,
76 NOT_IMPLEMENTED = 501,
78 SERVICE_UNAVAILABLE = 503,
79 GATEWAY_TIMEOUT = 504,
80 VERSION_NOT_SUPPORTED = 505
91 void setTimeout(
int seconds);
94 void setMethod(
const std::string &method);
95 const std::string &getMethod();
97 void setContentType(
const std::string &contentType);
98 const std::string &getContentType();
100 void setContentLength(std::streamsize length);
101 std::streamsize getContentLength();
103 void setBody(
const std::string &body);
104 void setBody(
const std::ostringstream &body);
105 void setBody(Poco::Net::HTMLForm &form);
106 const std::string &getBody();
109 const std::string &getResponseReason();
111 void addHeader(
const std::string &key,
const std::string &
value);
112 void removeHeader(
const std::string &key);
113 const std::string &getHeader(
const std::string &key);
116 virtual void reset();
124 virtual HTTPStatus downloadFile(
const std::string &urlFile,
const std::string &localFilePath =
"");
125 virtual HTTPStatus sendRequest(
const std::string &url, std::ostream &responseStream);
128 virtual HTTPStatus sendHTTPSRequest(
const std::string &url, std::ostream &responseStream);
129 virtual HTTPStatus sendHTTPRequest(
const std::string &url, std::ostream &responseStream);
130 virtual void processResponseHeaders(
const Poco::Net::HTTPResponse &res);
131 virtual HTTPStatus processErrorStates(
const Poco::Net::HTTPResponse &res, std::istream &rs,
const std::string &url);
132 virtual HTTPStatus sendRequestAndProcess(Poco::Net::HTTPClientSession &session, Poco::URI &uri,
133 std::ostream &responseStream);
135 void setupProxyOnSession(Poco::Net::HTTPClientSession &session,
const std::string &proxyUrl);
136 void createRequest(Poco::URI &uri);
139 void throwNotConnected(
const std::string &url,
const Poco::Net::HostNotFoundException &ex);
141 void logDebugRequestSending(
const std::string &schemeName,
const std::string &url)
const;
double value
The value of the point.
InternetHelper : A helper class for supporting access to resources through HTTP and HTTPS.
Kernel::ProxyInfo m_proxyInfo
std::string m_contentType
std::unique_ptr< Poco::Net::HTTPRequest > m_request
StringToStringMap m_headers
std::map< std::string, std::string > StringToStringMap
virtual ~InternetHelper()
Destructor.
std::streamsize m_contentLength
std::unique_ptr< Poco::Net::HTTPResponse > m_response
ProxyInfo : Container for carrying around network proxy information.
Helper class which provides the Collimation Length for SANS instruments.