QC_HTTPClient.dox.h
namespace Qore {
class HTTPClient : public Socket {
public:
nothing addDefaultHeaders(hash<auto> hdr);
public:
nothing clearProxyURL();
public:
nothing clearProxyUserPassword();
public:
clearStats();
public:
nothing clearUserPassword();
public:
nothing clearWarningQueue();
public:
nothing connect();
public:
constructor(hash<auto> opts);
public:
constructor();
public:
copy();
public:
destructor();
public:
nothing disconnect();
public:
*string get(string path, *hash<auto> headers, *reference<hash<auto>> info);
public:
string getAssumedEncoding();
public:
int getConnectTimeout();
public:
*string getConnectionPath();
public:
hash<string,string> getDefaultHeaders();
public:
string getDefaultPath();
public:
string getEncoding();
public:
bool getEncodingPassthru();
public:
bool getErrorPassthru();
public:
string getHTTPVersion();
public:
string getHostHeaderValue();
public:
int getMaxRedirects();
public:
bool getNoDelay();
public:
*string getProxyURL();
public:
bool getRedirectPassthru();
public:
int getTimeout();
public:
*string getURL();
public:
hash<auto> getUsageInfo();
public:
hash<auto> head(string path, *hash<auto> headers, *reference<hash<auto>> info);
public:
bool isConnected();
public:
bool isProxySecure();
public:
bool isSecure();
public:
*string post(string path, string body, *hash<auto> headers, *reference<hash<auto>> info);
public:
*string post(string path, *binary body, *hash<auto> headers, *reference<hash<auto>> info);
public:
hash<auto> send(string body, string method, *string path, *hash<auto> headers, softbool getbody = False, *reference<hash<auto>> info);
public:
hash<auto> send(*binary body, string method, *string path, *hash<auto> headers, softbool getbody = False, *reference<hash<auto>> info);
public:
nothing send(Qore::OutputStream os, *data body, string method, *string path, *hash<auto> headers, timeout timeout_ms = 0, softbool getbody = False, *reference<hash<auto>> info, *code rcb);
public:
nothing sendChunked(Qore::OutputStream os, Qore::InputStream is, string method, int max_chunk_size = 4096, *string path, *hash<auto> headers, timeout timeout_ms = 0, softbool getbody = False, *reference<hash<auto>> info, *code rcb, *code tcb);
public:
nothing sendWithCallbacks(code scb, code rcb, string method, *string path, *hash<auto> headers, timeout timeout_ms = 0, softbool getbody = False, *reference<hash<auto>> info);
public:
nothing sendWithRecvCallback(code rcb, string body, string method, *string path, *hash<auto> headers, timeout timeout_ms = 0, softbool getbody = False, *reference<hash<auto>> info);
public:
nothing sendWithRecvCallback(code rcb, *binary body, string method, *string path, *hash<auto> headers, timeout timeout_ms = 0, softbool getbody = False, *reference<hash<auto>> info);
public:
hash<auto> sendWithSendCallback(code scb, string method, *string path, *hash<auto> headers, timeout timeout_ms = 0, softbool getbody = False, *reference<hash> info);
public:
setAssumedEncoding(*string encoding);
public:
nothing setConnectTimeout(timeout timeout_ms = -1);
public:
setConnectionPath(*string uri_path);
public:
nothing setDefaultPath(*string path);
public:
nothing setEncoding(string encoding);
public:
bool setEncodingPassthru(bool set = True);
public:
bool setErrorPassthru(bool set = True);
public:
nothing setEventQueue();
public:
nothing setEventQueue(Qore::Thread::Queue queue, auto arg, *bool with_data);
public:
nothing setHTTPVersion(string ver);
public:
nothing setMaxRedirects(softint mr = 0);
public:
int setNoDelay(softbool b = True);
public:
setPersistent();
public:
nothing setProxySecure(softbool b = True);
public:
nothing setProxyURL();
public:
nothing setProxyURL(string url);
public:
nothing setProxyUserPassword(string user, string pass);
public:
nothing setProxyUserPassword();
public:
bool setRedirectPassthru(bool set = True);
public:
nothing setSecure(softbool secure = True);
public:
nothing setTimeout(timeout timeout_ms = 0);
public:
setURL(string url);
public:
nothing setUserPassword(string user, string pass);
public:
nothing setUserPassword();
public:
nothing setWarningQueue(int warning_ms, int warning_bs, Queue queue, auto arg, timeout min_ms = 1s);
};
}
Qore::HTTPClient::getDefaultHeaders
hash< string, string > getDefaultHeaders()
Returns a hash of default headers to be sent with every outgoing request.
Qore::HTTPClient::getNoDelay
bool getNoDelay()
Returns the TCP_NODELAY setting for the HTTPClient object.
Qore::HTTPClient::setWarningQueue
nothing setWarningQueue(int warning_ms, int warning_bs, Queue queue, auto arg, timeout min_ms=1s)
Sets a Queue object to receive socket warnings.
Qore::HTTPClient::setEncoding
nothing setEncoding(string encoding)
Sets the string encoding for the object; any strings deserialized with this object will be tagged wit...
Qore::HTTPClient::setDefaultPath
nothing setDefaultPath(*string path)
Sets the default path used by the object if no path is set in the URL.
Qore::Socket
The Socket class allows Qore programs safe access to network sockets.
Definition: QC_Socket.dox.h:136
Qore::HTTPClient::getEncoding
string getEncoding()
Returns the character encoding used for the object.
Qore::HTTPClient::clearWarningQueue
nothing clearWarningQueue()
Removes any warning Queue object from the Socket.
Qore::HTTPClient::setMaxRedirects
nothing setMaxRedirects(softint mr=0)
Updates the setting for the max_redirects value for the object (maximum number of HTTP redirects that...
Qore::True
const True
logical True
Definition: qc_qore.dox.h:98
Qore::HTTPClient::isSecure
bool isSecure()
Returns True if the current connection is encrypted, False if not.
Qore::HTTPClient::isConnected
bool isConnected()
Returns True or False giving the current connection state.
Qore::HTTPClient::setRedirectPassthru
bool setRedirectPassthru(bool set=True)
set the redirect passthru status
Qore::binary
binary binary()
Always returns an empty binary object (of zero length)
Qore::HTTPClient::setTimeout
nothing setTimeout(timeout timeout_ms=0)
Sets the default I/O timeout value in milliseconds.
Qore::HTTPClient::getTimeout
int getTimeout()
Returns the default I/O timeout as an integer in milliseconds.
Qore::HTTPClient::constructor
constructor()
Creates the HTTPClient object.
Qore::HTTPClient::setSecure
nothing setSecure(softbool secure=True)
Sets the object to make a secure SSL/TLS connection on the next connect if the passed argument is Tru...
Qore::HTTPClient::getHTTPVersion
string getHTTPVersion()
Returns the HTTP protocol version string used in outgoing messages.
Qore::False
const False
logical False
Definition: qc_qore.dox.h:96
Qore::HTTPClient::setProxySecure
nothing setProxySecure(softbool b=True)
Sets the SSL/TLS flag for the next connection to the proxy.
Qore::HTTPClient::clearProxyUserPassword
nothing clearProxyUserPassword()
Clears the username and password for the next proxy connection.
Qore::HTTPClient::sendWithRecvCallback
nothing sendWithRecvCallback(code rcb, string body, string method, *string path, *hash< auto > headers, timeout timeout_ms=0, softbool getbody=False, *reference< hash< auto >> info)
Sends an HTTP request with the specified method and optional message body; headers and any body recei...
Qore::HTTPClient::setEncodingPassthru
bool setEncodingPassthru(bool set=True)
set the encoding passthru status
Qore::HTTPClient::setProxyURL
nothing setProxyURL()
Clears the new proxy URL value for the next connection.
Qore::HTTPClient::setProxyUserPassword
nothing setProxyUserPassword()
Clears the username and password for the next proxy connection.
Qore::HTTPClient::head
hash< auto > head(string path, *hash< auto > headers, *reference< hash< auto >> info)
Sends an HTTP HEAD request and returns as hash of the headers received.
Qore::HTTPClient::getAssumedEncoding
string getAssumedEncoding()
returns the assumed character encoding for messages from the HTTP server without any charset indicato...
Qore::HTTPClient::getRedirectPassthru
bool getRedirectPassthru()
get the redirect passthru status
Qore::HTTPClient::getURL
*string getURL()
Returns the current URL.
Qore::HTTPClient::setConnectionPath
setConnectionPath(*string uri_path)
Overrides any connection path set in the URL.
Qore::HTTPClient::setAssumedEncoding
setAssumedEncoding(*string encoding)
sets the assumed character encoding for messages from the HTTP server without any charset indicator ...
Qore::HTTPClient::copy
copy()
Copying objects of this class is not supported, an exception will be thrown.
Qore::HTTPClient
The HTTPClient class can be used to communicate with HTTP servers with and without TLS/SSL encryption...
Definition: QC_HTTPClient.dox.h:199
Qore::HTTPClient::sendWithSendCallback
hash< auto > sendWithSendCallback(code scb, string method, *string path, *hash< auto > headers, timeout timeout_ms=0, softbool getbody=False, *reference< hash > info)
Sends an HTTP request with the specified method and chunked message body as given by a send callback ...
Qore::OutputStream
This class defines an abstract interface for output streams.
Definition: QC_OutputStream.dox.h:18
Qore::HTTPClient::connect
nothing connect()
Connects to the remote socket; SSL/TLS negotiation is performed if required.
Qore::HTTPClient::getEncodingPassthru
bool getEncodingPassthru()
get the encoding passthru status
Qore::HTTPClient::clearProxyURL
nothing clearProxyURL()
Clears the new proxy URL value for the next connection.
Qore::HTTPClient::getUsageInfo
hash< auto > getUsageInfo()
Returns performance statistics for the socket.
Qore::HTTPClient::disconnect
nothing disconnect()
Disconnects from the remote socket if a connection is established (otherwise does nothing) ...
Qore::HTTPClient::clearUserPassword
nothing clearUserPassword()
Clears the username and password for the connection.
Qore::HTTPClient::sendChunked
nothing sendChunked(Qore::OutputStream os, Qore::InputStream is, string method, int max_chunk_size=4096, *string path, *hash< auto > headers, timeout timeout_ms=0, softbool getbody=False, *reference< hash< auto >> info, *code rcb, *code tcb)
Sends a chunked HTTP request with the specified method and message body; headers are returned through...
Qore::HTTPClient::setConnectTimeout
nothing setConnectTimeout(timeout timeout_ms=-1)
Sets the connect timeout in milliseconds.
Qore::HTTPClient::getHostHeaderValue
string getHostHeaderValue()
returns the Host header value for this object
Qore::HTTPClient::getConnectionPath
*string getConnectionPath()
Returns the current connection path set in the URL.
Qore::HTTPClient::clearStats
clearStats()
Clears performance statistics.
Qore::HTTPClient::addDefaultHeaders
nothing addDefaultHeaders(hash< auto > hdr)
Sets headers to send by default with every outgoing request.
Qore::HTTPClient::getConnectTimeout
int getConnectTimeout()
Returns the connect timeout as an integer in milliseconds.
Qore::HTTPClient::isProxySecure
bool isProxySecure()
Returns the SSL/TLS flag for the next proxy connection.
Qore::HTTPClient::destructor
destructor()
Destroys the HTTPClient object and closes any open connections.
Qore::Thread::Queue
Queue objects provide a blocking, thread-safe message-passing object to Qore programs ...
Definition: QC_Queue.dox.h:22
Qore::HTTPClient::setErrorPassthru
bool setErrorPassthru(bool set=True)
set the error passthru status
Qore::HTTPClient::getMaxRedirects
int getMaxRedirects()
Returns the current max_redirects value for the object (the maximum number of HTTP redirects that wil...
Qore::HTTPClient::setEventQueue
nothing setEventQueue()
Clears any Queue object that may be set on the HTTPClient object so that I/O events are no longer cap...
Qore::HTTPClient::post
*string post(string path, string body, *hash< auto > headers, *reference< hash< auto >> info)
Sends an HTTP POST request with a message body and returns the message body received as a string or N...
Qore::HTTPClient::sendWithCallbacks
nothing sendWithCallbacks(code scb, code rcb, string method, *string path, *hash< auto > headers, timeout timeout_ms=0, softbool getbody=False, *reference< hash< auto >> info)
Sends an HTTP request with the specified method and chunked message body as given by a send callback;...
Qore::HTTPClient::send
hash< auto > send(string body, string method, *string path, *hash< auto > headers, softbool getbody=False, *reference< hash< auto >> info)
Sends an HTTP request with the specified method and optional message body and returns headers and any...
Qore::HTTPClient::setURL
setURL(string url)
Sets a new URL value for the next connection.
Qore::HTTPClient::setPersistent
setPersistent()
temporarily disables implicit reconnections; must be called when the server is already connected ...
Qore
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:3
Qore::HTTPClient::getDefaultPath
string getDefaultPath()
Returns the default path used by the object if no path is set in the URL.
Qore::InputStream
This class defines an abstract interface for input streams.
Definition: QC_InputStream.dox.h:19
Qore::HTTPClient::setUserPassword
nothing setUserPassword()
Clears the username and password for the connection.
Qore::HTTPClient::getProxyURL
*string getProxyURL()
Returns the current proxy URL as a string or NOTHING if no proxy URL is set.
Qore::HTTPClient::setNoDelay
int setNoDelay(softbool b=True)
Sets the TCP_NODELAY setting for the object.
Qore::HTTPClient::getErrorPassthru
bool getErrorPassthru()
get the error passthru status
Qore::HTTPClient::setHTTPVersion
nothing setHTTPVersion(string ver)
Sets the HTTP protocol version string for headers in outgoing messages, allowed values are "1...