|
ofxHTTP
A collection of tools for HTTP.
|
A Context is a collection of data that supports a client session. More...
#include <Context.h>
Public Member Functions | |
| Context () | |
| Create a default Context. | |
| Context (const ClientSessionSettings &sessionSettings) | |
| Create a Context with the given settings. More... | |
| virtual | ~Context () |
| Destroy the Context. | |
| void | setClientSessionSettings (const ClientSessionSettings &sessionSettings) |
| Set the ClientSessionSettings. More... | |
| const ClientSessionSettings & | getClientSessionSettings () const |
| void | setClientSession (std::unique_ptr< Poco::Net::HTTPClientSession > clientSession) |
| Set the client session to use. More... | |
| std::unique_ptr< Poco::Net::HTTPClientSession > | releaseClientSession () |
| Release the client session. More... | |
| Poco::Net::HTTPClientSession * | clientSession () |
| Get a pointer to the current HTTP session for this context. More... | |
| const Poco::Net::HTTPClientSession * | clientSession () const |
| Get a const pointer to the current HTTP session for this context. More... | |
| void | addRedirect (const Poco::URI &uri) |
| Add to the history of redirects. More... | |
| const std::vector< Poco::URI > & | getRedirects () const |
| void | setProxyRedirectURI (const Poco::URI &uri) |
| Set the URI that should be used if a proxy is required. More... | |
| const Poco::URI & | getProxyRedirectURI () const |
| void | setResubmit (bool resubmit) |
| Set whether the current session should be resubmitted. More... | |
| bool | getResubmit () const |
| ClientState | getState () const |
| void | setState (ClientState state) |
Public Attributes | |
| ClientEvents | events |
| Client events. | |
Friends | |
| class | Client |
| class | ClientSessionProvider |
A Context is a collection of data that supports a client session.
This Context stores various attributes including session settings, redirects cookie stores, etc.
| ofx::HTTP::Context::Context | ( | const ClientSessionSettings & | sessionSettings | ) |
Create a Context with the given settings.
| settings | The ClientSessionSettings to use. |
| void ofx::HTTP::Context::addRedirect | ( | const Poco::URI & | uri | ) |
Add to the history of redirects.
| uri | The URI to add. |
| Poco::Net::HTTPClientSession * ofx::HTTP::Context::clientSession | ( | ) |
| const Poco::Net::HTTPClientSession * ofx::HTTP::Context::clientSession | ( | ) | const |
| const ClientSessionSettings & ofx::HTTP::Context::getClientSessionSettings | ( | ) | const |
| const Poco::URI & ofx::HTTP::Context::getProxyRedirectURI | ( | ) | const |
| const std::vector< Poco::URI > & ofx::HTTP::Context::getRedirects | ( | ) | const |
| bool ofx::HTTP::Context::getResubmit | ( | ) | const |
| ClientState ofx::HTTP::Context::getState | ( | ) | const |
| std::unique_ptr< Poco::Net::HTTPClientSession > ofx::HTTP::Context::releaseClientSession | ( | ) |
Release the client session.
This is typically recalled by the client session provider to (possibly) be reused.
| void ofx::HTTP::Context::setClientSession | ( | std::unique_ptr< Poco::Net::HTTPClientSession > | clientSession | ) |
Set the client session to use.
This is typically provided by the DefaultClientSessionProvider. The Context will take ownership of the HTTPClientSession.
| clientSession | The client session to take ownership of. |
| void ofx::HTTP::Context::setClientSessionSettings | ( | const ClientSessionSettings & | sessionSettings | ) |
Set the ClientSessionSettings.
| settings | The ClientSessionSettings to set. |
| void ofx::HTTP::Context::setProxyRedirectURI | ( | const Poco::URI & | uri | ) |
Set the URI that should be used if a proxy is required.
| uri | The proxy redirect URI. |
| void ofx::HTTP::Context::setResubmit | ( | bool | resubmit | ) |
Set whether the current session should be resubmitted.
Resubmits can be set if request filters require it (e.g. Proxy filters).
| resubmit | true if the associated request should be resubmitted. |