Logo Search packages:      
Sourcecode: poco version File versions  Download package

Poco::Net::HTTPSClientSession Class Reference

#include <HTTPSClientSession.h>

Inheritance diagram for Poco::Net::HTTPSClientSession:

Poco::Net::HTTPClientSession Poco::Net::HTTPSession

List of all members.


Detailed Description

This class implements the client-side of a HTTPS session.

To send a HTTPS request to a HTTPS server, first instantiate a HTTPSClientSession object and specify the server's host name and port number.

Then create a HTTPRequest object, fill it accordingly, and pass it as argument to the sendRequst() method.

sendRequest() will return an output stream that can be used to send the request body, if there is any.

After you are done sending the request body, create a HTTPResponse object and pass it to receiveResponse().

This will return an input stream that can be used to read the response body.

See RFC 2616 <http://www.faqs.org/rfcs/rfc2616.html> for more information about the HTTP protocol.

Definition at line 57 of file HTTPSClientSession.h.


Public Types

enum  { HTTP_PORT = 80 }

Public Member Functions

void abort ()
 Returns true if the underlying socket is connected.
bool connected () const
 Returns the timeout for the HTTP session.
const std::string & getHost () const
bool getKeepAlive () const
Poco::UInt16 getPort () const
const std::string & getProxyHost () const
 Sets the port number of the proxy server.
Poco::UInt16 getProxyPort () const
 Returns the proxy host name.
Poco::Timespan getTimeout () const
 Sets the timeout for the HTTP session.
 HTTPSClientSession (const std::string &host, Poco::UInt16 port=Utility::HTTPS_PORT)
 HTTPSClientSession (const SecureStreamSocket &socket)
 Creates an unconnected HTTPSClientSession.
const Poco::ExceptionnetworkException () const
std::istream & receiveResponse (HTTPResponse &response)
std::ostream & sendRequest (HTTPRequest &request)
void setHost (const std::string &host)
void setKeepAlive (bool keepAlive)
void setPort (Poco::UInt16 port)
 Returns the host name of the target HTTP server.
void setProxy (const std::string &host, Poco::UInt16 port=HTTPSession::HTTP_PORT)
 Returns the port number of the target HTTP server.
void setProxyHost (const std::string &host)
 Sets the proxy host name and port number.
void setProxyPort (Poco::UInt16 port)
 Sets the host name of the proxy server.
void setTimeout (const Poco::Timespan &timeout)
 ~HTTPSClientSession ()
 Creates a HTTPSClientSession using the given host and port.

Protected Member Functions

void close ()
void connect (const SocketAddress &address)
void deleteRequestStream ()
 Deletes the response stream and sets it to 0.
void deleteResponseStream ()
 Returns the target host and port number for proxy requests.
int get ()
bool getExpectResponseBody () const
 Sets _expectResponseBody.
std::string getHostInfo () const
 Tries to re-connect if keep-alive is on.
std::ostream * getRequestStream () const
 Returns the currently set response stream. Can return 0.
std::istream * getResponseStream () const
 Sets the request stream iff _pRequestStream is 0.
int peek ()
virtual int read (char *buffer, std::streamsize length)
int receive (char *buffer, int length)
 Writes data to the socket.
void reconnect ()
void refill ()
 Returns a reference to the underlying socket.
void setException (const Poco::Exception &exc)
 Closes the underlying socket.
void setExpectResponseBody (bool expect)
 Sets _reconnect.
void setReconnect (bool recon)
 Returns the currently set request stream. Can return 0.
void setRequestStream (std::ostream *pRequestStream)
 Sets the response stream iff _pResponseStream is 0.
void setResponseStream (std::istream *pRespStream)
 Deletes the request stream and sets it to 0.
StreamSocketsocket ()
 Reads up to length bytes.
int write (const char *buffer, std::streamsize length)
 Connects the underlying socket to the HTTP server.

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index