Qore Programming Language Reference Manual  0.9.3
QC_HTTPClient.dox.h
1 namespace Qore {
4 
158 class HTTPClient : public Socket {
159 
160 public:
162 
167 nothing clearProxyURL();
168 
169 public:
171 
178 nothing clearProxyUserPassword();
179 
180 public:
182 
191  clearStats();
192 
193 public:
195 
202 nothing clearUserPassword();
203 
204 public:
206 
215 nothing clearWarningQueue();
216 
217 public:
219 
233 nothing connect();
234 
235 public:
237 
291  constructor(hash<auto> opts);
292 
293 public:
295 
300  constructor();
301 
302 public:
304 
306  copy();
307 
308 public:
310 
315  destructor();
316 
317 public:
319 
324 nothing disconnect();
325 
326 public:
328 
382 *string get(string path, *hash<auto> headers, *reference<hash<auto>> info);
383 
384 public:
386 
396 int getConnectTimeout();
397 
398 public:
400 
410 *string getConnectionPath();
411 
412 public:
414 
424 string getDefaultPath();
425 
426 public:
428 
438 string getEncoding();
439 
440 public:
442 
457 bool getEncodingPassthru();
458 
459 public:
461 
477 bool getErrorPassthru();
478 
479 public:
481 
491 string getHTTPVersion();
492 
493 public:
495 
507 string getHostHeaderValue();
508 
509 public:
511 
521 int getMaxRedirects();
522 
523 public:
525 
535 bool getNoDelay();
536 
537 public:
539 
549 *string getProxyURL();
550 
551 public:
553 
567 bool getRedirectPassthru();
568 
569 public:
571 
581 int getTimeout();
582 
583 public:
585 
595 *string getURL();
596 
597 public:
599 
620 hash<auto> getUsageInfo();
621 
622 public:
624 
672 hash<auto> head(string path, *hash<auto> headers, *reference<hash<auto>> info);
673 
674 public:
676 
686 bool isConnected();
687 
688 public:
690 
700 bool isProxySecure();
701 
702 public:
704 
715 bool isSecure();
716 
717 public:
719 
771 *string post(string path, string body, *hash<auto> headers, *reference<hash<auto>> info);
772 
773 public:
775 
826 *string post(string path, *binary body, *hash<auto> headers, *reference<hash<auto>> info);
827 
828 public:
830 
882 hash<auto> send(string body, string method, *string path, *hash<auto> headers, softbool getbody = False, *reference<hash<auto>> info);
883 
884 public:
886 
937 hash<auto> send(*binary body, string method, *string path, *hash<auto> headers, softbool getbody = False, *reference<hash<auto>> info);
938 
939 public:
941 
996 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);
997 
998 public:
1000 
1063 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);
1064 
1065 public:
1067 
1133 nothing sendWithCallbacks(code scb, code rcb, string method, *string path, *hash<auto> headers, timeout timeout_ms = 0, softbool getbody = False, *reference<hash<auto>> info);
1134 
1135 public:
1137 
1199 nothing sendWithRecvCallback(code rcb, string body, string method, *string path, *hash<auto> headers, timeout timeout_ms = 0, softbool getbody = False, *reference<hash<auto>> info);
1200 
1201 public:
1203 
1263 nothing sendWithRecvCallback(code rcb, *binary body, string method, *string path, *hash<auto> headers, timeout timeout_ms = 0, softbool getbody = False, *reference<hash<auto>> info);
1264 
1265 public:
1267 
1324 hash<auto> sendWithSendCallback(code scb, string method, *string path, *hash<auto> headers, timeout timeout_ms = 0, softbool getbody = False, *reference<hash> info);
1325 
1326 public:
1328 
1335 nothing setConnectTimeout(timeout timeout_ms = -1);
1336 
1337 public:
1339 
1346 nothing setDefaultPath(*string path);
1347 
1348 public:
1350 
1357 nothing setEncoding(string encoding);
1358 
1359 public:
1361 
1376 bool setEncodingPassthru(bool set = True);
1377 
1378 public:
1380 
1397 bool setErrorPassthru(bool set = True);
1398 
1399 public:
1401 
1406 nothing setEventQueue();
1407 
1408 public:
1410 
1421 nothing setEventQueue(Qore::Thread::Queue queue);
1422 
1423 public:
1425 
1434 nothing setHTTPVersion(string ver);
1435 
1436 public:
1438 
1447 nothing setMaxRedirects(softint mr = 0);
1448 
1449 public:
1451 
1468 int setNoDelay(softbool b = True);
1469 
1470 public:
1472 
1484  setPersistent();
1485 
1486 public:
1488 
1495 nothing setProxySecure(softbool b = True);
1496 
1497 public:
1499 
1506 nothing setProxyURL();
1507 
1508 public:
1510 
1522 nothing setProxyURL(string url);
1523 
1524 public:
1526 
1536 nothing setProxyUserPassword(string user, string pass);
1537 
1538 public:
1540 
1551 nothing setProxyUserPassword();
1552 
1553 public:
1555 
1568 bool setRedirectPassthru(bool set = True);
1569 
1570 public:
1572 
1583 nothing setSecure(softbool secure = True);
1584 
1585 public:
1587 
1594 nothing setTimeout(timeout timeout_ms = 0);
1595 
1596 public:
1598 
1614  setURL(string url);
1615 
1616 public:
1618 
1628 nothing setUserPassword(string user, string pass);
1629 
1630 public:
1632 
1643 nothing setUserPassword();
1644 
1645 public:
1647 
1679 nothing setWarningQueue(int warning_ms, int warning_bs, Queue queue, auto arg, timeout min_ms = 1s);
1680 };
1681 };
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: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.
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: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 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.
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:158
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:15
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:2
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....