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