Qore Programming Language Reference Manual  0.8.12.3
QC_HTTPClient.dox.h
1 namespace Qore {
4 
141 class HTTPClient : public Socket {
142 
143 public:
145 
150 nothing clearProxyURL();
151 
152 public:
154 
161 nothing clearProxyUserPassword();
162 
163 public:
165 
174  clearStats();
175 
176 public:
178 
185 nothing clearUserPassword();
186 
187 public:
189 
198 nothing clearWarningQueue();
199 
200 public:
202 
216 nothing connect();
217 
218 public:
220 
249  constructor(hash opts);
250 
251 public:
253 
258  constructor();
259 
260 public:
262 
264  copy();
265 
266 public:
268 
273  destructor();
274 
275 public:
277 
282 nothing disconnect();
283 
284 public:
286 
318 *string get(string path, *hash headers, *reference info);
319 
320 public:
322 
332 int getConnectTimeout();
333 
334 public:
336 
346 *string getConnectionPath();
347 
348 public:
350 
360 string getDefaultPath();
361 
362 public:
364 
374 string getEncoding();
375 
376 public:
378 
388 string getHTTPVersion();
389 
390 public:
392 
402 int getMaxRedirects();
403 
404 public:
406 
416 bool getNoDelay();
417 
418 public:
420 
430 *string getProxyURL();
431 
432 public:
434 
444 int getTimeout();
445 
446 public:
448 
458 *string getURL();
459 
460 public:
462 
484 
485 public:
487 
515 hash head(string path, *hash headers, *reference info);
516 
517 public:
519 
529 bool isConnected();
530 
531 public:
533 
543 bool isProxySecure();
544 
545 public:
547 
558 bool isSecure();
559 
560 public:
562 
594 *string post(string path, string body, *hash headers, *reference info);
595 
596 public:
598 
629 *string post(string path, *binary body, *hash headers, *reference info);
630 
631 public:
633 
663 hash send(string body, string method, *string path, *hash headers, softbool getbody = False, *reference info);
664 
665 public:
667 
697 hash send(*binary body, string method, *string path, *hash headers, softbool getbody = False, *reference info);
698 
699 public:
701 
745 nothing sendWithCallbacks(code scb, code rcb, string method, *string path, *hash headers, timeout timeout_ms = 0, softbool getbody = False, *reference info);
746 
747 public:
749 
789 nothing sendWithRecvCallback(code rcb, string body, string method, *string path, *hash headers, timeout timeout_ms = 0, softbool getbody = False, *reference info);
790 
791 public:
793 
833 nothing sendWithRecvCallback(code rcb, *binary body, string method, *string path, *hash headers, timeout timeout_ms = 0, softbool getbody = False, *reference info);
834 
835 public:
837 
873 hash sendWithSendCallback(code scb, string method, *string path, *hash headers, timeout timeout_ms = 0, softbool getbody = False, *reference info);
874 
875 public:
877 
884 nothing setConnectTimeout(timeout timeout_ms = -1);
885 
886 public:
888 
895 nothing setDefaultPath(*string path);
896 
897 public:
899 
906 nothing setEncoding(string encoding);
907 
908 public:
910 
915 nothing setEventQueue();
916 
917 public:
919 
930 nothing setEventQueue(Qore::Thread::Queue queue);
931 
932 public:
934 
943 nothing setHTTPVersion(string ver);
944 
945 public:
947 
956 nothing setMaxRedirects(softint mr = 0);
957 
958 public:
960 
977 int setNoDelay(softbool b = True);
978 
979 public:
981 
993  setPersistent();
994 
995 public:
997 
1004 nothing setProxySecure(softbool b = True);
1005 
1006 public:
1008 
1015 nothing setProxyURL();
1016 
1017 public:
1019 
1031 nothing setProxyURL(string url);
1032 
1033 public:
1035 
1045 nothing setProxyUserPassword(string user, string pass);
1046 
1047 public:
1049 
1060 nothing setProxyUserPassword();
1061 
1062 public:
1064 
1075 nothing setSecure(softbool secure = True);
1076 
1077 public:
1079 
1086 nothing setTimeout(timeout timeout_ms = 0);
1087 
1088 public:
1090 
1106  setURL(string url);
1107 
1108 public:
1110 
1120 nothing setUserPassword(string user, string pass);
1121 
1122 public:
1124 
1135 nothing setUserPassword();
1136 
1137 public:
1139 
1171 nothing setWarningQueue(int warning_ms, int warning_bs, Queue queue, any arg, timeout min_ms = 1s);
1172 };
1173 };
hash getUsageInfo()
Returns performance statistics for the socket.
nothing setWarningQueue(int warning_ms, int warning_bs, Queue queue, any arg, timeout min_ms=1s)
Sets a Queue object to receive socket warnings.
nothing sendWithCallbacks(code scb, code rcb, string method, *string path, *hash headers, timeout timeout_ms=0, softbool getbody=False, *reference 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.
nothing setEncoding(string encoding)
Sets the string encoding for the object; any strings deserialized with this object will be tagged wit...
nothing setDefaultPath(*string path)
Sets the default path used by the object if no path is set in the URL.
The Socket class allows Qore programs safe access to network sockets.
Definition: QC_Socket.dox.h:122
string getEncoding()
Returns the character encoding used for the object.
nothing clearWarningQueue()
Removes any warning Queue object from the Socket.
nothing setMaxRedirects(softint mr=0)
Updates the setting for the max_redirects value for the object (maximum number of HTTP redirects that...
const True
logical True
Definition: qc_qore.dox.h:94
bool isSecure()
Returns True if the current connection is encrypted, False if not.
bool isConnected()
Returns True or False giving the current connection state.
binary binary()
Always returns an empty binary object (of zero length)
nothing setTimeout(timeout timeout_ms=0)
Sets the default I/O timeout value in milliseconds.
int getTimeout()
Returns the default I/O timeout as an integer in milliseconds.
constructor()
Creates the HTTPClient object.
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...
string getHTTPVersion()
Returns the HTTP protocol version string used in outgoing messages.
const False
logical False
Definition: qc_qore.dox.h:92
nothing setProxySecure(softbool b=True)
Sets the SSL/TLS flag for the next connection to the proxy.
nothing clearProxyUserPassword()
Clears the username and password for the next proxy connection.
nothing setProxyURL()
Clears the new proxy URL value for the next connection.
*string post(string path, string body, *hash headers, *reference info)
Sends an HTTP POST request with a message body and returns the message body received as a string or N...
nothing setProxyUserPassword()
Clears the username and password for the next proxy connection.
nothing sendWithRecvCallback(code rcb, string body, string method, *string path, *hash headers, timeout timeout_ms=0, softbool getbody=False, *reference info)
Sends an HTTP request with the specified method and optional message body; headers and any body recei...
hash head(string path, *hash headers, *reference info)
Sends an HTTP HEAD request and returns as hash of the headers received.
*string getURL()
Returns the current URL.
hash send(string body, string method, *string path, *hash headers, softbool getbody=False, *reference info)
Sends an HTTP request with the specified method and optional message body and returns headers and any...
copy()
Copying objects of this class is not supported, an exception will be thrown.
The HTTPClient class can be used to communicate with HTTP servers with and without TLS/SSL encryption...
Definition: QC_HTTPClient.dox.h:141
nothing connect()
Connects to the remote socket; SSL/TLS negotiation is performed if required.
nothing clearProxyURL()
Clears the new proxy URL value for the next connection.
nothing disconnect()
Disconnects from the remote socket if a connection is established (otherwise does nothing) ...
nothing clearUserPassword()
Clears the username and password for the connection.
nothing setConnectTimeout(timeout timeout_ms=-1)
Sets the connect timeout in milliseconds.
*string getConnectionPath()
Returns the current connection path set in the URL.
clearStats()
Clears performance statistics.
int getConnectTimeout()
Returns the connect timeout as an integer in milliseconds.
bool isProxySecure()
Returns the SSL/TLS flag for the next proxy connection.
destructor()
Destroys the HTTPClient object and closes any open connections.
Queue objects provide a blocking, thread-safe message-passing object to Qore programs ...
Definition: QC_Queue.dox.h:15
int getMaxRedirects()
Returns the current max_redirects value for the object (the maximum number of HTTP redirects that wil...
nothing setEventQueue()
Clears any Queue object that may be set on the HTTPClient object so that I/O events are no longer cap...
setURL(string url)
Sets a new URL value for the next connection.
setPersistent()
temporarily disables implicit reconnections; must be called when the server is already connected ...
hash sendWithSendCallback(code scb, string method, *string path, *hash headers, timeout timeout_ms=0, softbool getbody=False, *reference info)
Sends an HTTP request with the specified method and chunked message body as given by a send callback ...
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:2
string getDefaultPath()
Returns the default path used by the object if no path is set in the URL.
nothing setUserPassword()
Clears the username and password for the connection.
hash hash(object obj)
Returns a hash of an object's members.
*string getProxyURL()
Returns the current proxy URL as a string or NOTHING if no proxy URL is set.
int setNoDelay(softbool b=True)
Sets the TCP_NODELAY setting for the object.
nothing setHTTPVersion(string ver)
Sets the HTTP protocol version string for headers in outgoing messages, allowed values are "1...