Qore Programming Language Reference Manual  0.9.4
QC_HTTPClient.dox.h
1 
3 namespace Qore {
5 
159 class HTTPClient : public Socket {
160 
161 public:
163 
168 nothing clearProxyURL();
169 
170 public:
172 
179 nothing clearProxyUserPassword();
180 
181 public:
183 
192  clearStats();
193 
194 public:
196 
203 nothing clearUserPassword();
204 
205 public:
207 
216 nothing clearWarningQueue();
217 
218 public:
220 
234 nothing connect();
235 
236 public:
238 
292  constructor(hash<auto> opts);
293 
294 public:
296 
301  constructor();
302 
303 public:
305 
307  copy();
308 
309 public:
311 
316  destructor();
317 
318 public:
320 
325 nothing disconnect();
326 
327 public:
329 
383 *string get(string path, *hash<auto> headers, *reference<hash<auto>> info);
384 
385 public:
387 
397 int getConnectTimeout();
398 
399 public:
401 
413 *string getConnectionPath();
414 
415 public:
417 
427 string getDefaultPath();
428 
429 public:
431 
441 string getEncoding();
442 
443 public:
445 
460 bool getEncodingPassthru();
461 
462 public:
464 
480 bool getErrorPassthru();
481 
482 public:
484 
494 string getHTTPVersion();
495 
496 public:
498 
510 string getHostHeaderValue();
511 
512 public:
514 
524 int getMaxRedirects();
525 
526 public:
528 
538 bool getNoDelay();
539 
540 public:
542 
552 *string getProxyURL();
553 
554 public:
556 
570 bool getRedirectPassthru();
571 
572 public:
574 
584 int getTimeout();
585 
586 public:
588 
598 *string getURL();
599 
600 public:
602 
623 hash<auto> getUsageInfo();
624 
625 public:
627 
675 hash<auto> head(string path, *hash<auto> headers, *reference<hash<auto>> info);
676 
677 public:
679 
689 bool isConnected();
690 
691 public:
693 
703 bool isProxySecure();
704 
705 public:
707 
718 bool isSecure();
719 
720 public:
722 
774 *string post(string path, string body, *hash<auto> headers, *reference<hash<auto>> info);
775 
776 public:
778 
829 *string post(string path, *binary body, *hash<auto> headers, *reference<hash<auto>> info);
830 
831 public:
833 
885 hash<auto> send(string body, string method, *string path, *hash<auto> headers, softbool getbody = False, *reference<hash<auto>> info);
886 
887 public:
889 
940 hash<auto> send(*binary body, string method, *string path, *hash<auto> headers, softbool getbody = False, *reference<hash<auto>> info);
941 
942 public:
944 
999 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);
1000 
1001 public:
1003 
1066 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);
1067 
1068 public:
1070 
1136 nothing sendWithCallbacks(code scb, code rcb, string method, *string path, *hash<auto> headers, timeout timeout_ms = 0, softbool getbody = False, *reference<hash<auto>> info);
1137 
1138 public:
1140 
1202 nothing sendWithRecvCallback(code rcb, string body, string method, *string path, *hash<auto> headers, timeout timeout_ms = 0, softbool getbody = False, *reference<hash<auto>> info);
1203 
1204 public:
1206 
1266 nothing sendWithRecvCallback(code rcb, *binary body, string method, *string path, *hash<auto> headers, timeout timeout_ms = 0, softbool getbody = False, *reference<hash<auto>> info);
1267 
1268 public:
1270 
1327 hash<auto> sendWithSendCallback(code scb, string method, *string path, *hash<auto> headers, timeout timeout_ms = 0, softbool getbody = False, *reference<hash> info);
1328 
1329 public:
1331 
1338 nothing setConnectTimeout(timeout timeout_ms = -1);
1339 
1340 public:
1342 
1351  setConnectionPath(*string uri_path);
1352 
1353 public:
1355 
1362 nothing setDefaultPath(*string path);
1363 
1364 public:
1366 
1373 nothing setEncoding(string encoding);
1374 
1375 public:
1377 
1392 bool setEncodingPassthru(bool set = True);
1393 
1394 public:
1396 
1413 bool setErrorPassthru(bool set = True);
1414 
1415 public:
1417 
1422 nothing setEventQueue();
1423 
1424 public:
1426 
1441 nothing setEventQueue(Qore::Thread::Queue queue, auto arg, *bool with_data);
1442 
1443 public:
1445 
1454 nothing setHTTPVersion(string ver);
1455 
1456 public:
1458 
1467 nothing setMaxRedirects(softint mr = 0);
1468 
1469 public:
1471 
1488 int setNoDelay(softbool b = True);
1489 
1490 public:
1492 
1504  setPersistent();
1505 
1506 public:
1508 
1515 nothing setProxySecure(softbool b = True);
1516 
1517 public:
1519 
1526 nothing setProxyURL();
1527 
1528 public:
1530 
1542 nothing setProxyURL(string url);
1543 
1544 public:
1546 
1556 nothing setProxyUserPassword(string user, string pass);
1557 
1558 public:
1560 
1571 nothing setProxyUserPassword();
1572 
1573 public:
1575 
1588 bool setRedirectPassthru(bool set = True);
1589 
1590 public:
1592 
1603 nothing setSecure(softbool secure = True);
1604 
1605 public:
1607 
1614 nothing setTimeout(timeout timeout_ms = 0);
1615 
1616 public:
1618 
1634  setURL(string url);
1635 
1636 public:
1638 
1648 nothing setUserPassword(string user, string pass);
1649 
1650 public:
1652 
1663 nothing setUserPassword();
1664 
1665 public:
1667 
1699 nothing setWarningQueue(int warning_ms, int warning_bs, Queue queue, auto arg, timeout min_ms = 1s);
1700 };
1701 }
bool getNoDelay()
Returns the TCP_NODELAY setting for the HTTPClient object.
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 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:123
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:98
bool isSecure()
Returns True if the current connection is encrypted, False if not.
bool isConnected()
Returns True or False giving the current connection state.
bool setRedirectPassthru(bool set=True)
set the redirect passthru status
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:96
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 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...
bool setEncodingPassthru(bool set=True)
set the encoding passthru status
nothing setProxyURL()
Clears the new proxy URL value for the next connection.
nothing setProxyUserPassword()
Clears the username and password for the next proxy connection.
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.
bool getRedirectPassthru()
get the redirect passthru status
*string getURL()
Returns the current URL.
setConnectionPath(*string uri_path)
Overrides any connection path set in the URL.
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:159
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 ...
This class defines an abstract interface for output streams.
Definition: QC_OutputStream.dox.h:18
nothing connect()
Connects to the remote socket; SSL/TLS negotiation is performed if required.
bool getEncodingPassthru()
get the encoding passthru status
nothing clearProxyURL()
Clears the new proxy URL value for the next connection.
hash< auto > getUsageInfo()
Returns performance statistics for the socket.
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 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...
nothing setConnectTimeout(timeout timeout_ms=-1)
Sets the connect timeout in milliseconds.
string getHostHeaderValue()
returns the Host header value for this object
*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:17
bool setErrorPassthru(bool set=True)
set the error passthru status
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...
*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 ...
*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...
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;...
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...
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
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:3
string getDefaultPath()
Returns the default path used by the object if no path is set in the URL.
This class defines an abstract interface for input streams.
Definition: QC_InputStream.dox.h:18
nothing setUserPassword()
Clears the username and password for the connection.
*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.
bool getErrorPassthru()
get the error passthru status
nothing setHTTPVersion(string ver)
Sets the HTTP protocol version string for headers in outgoing messages, allowed values are "1....