\hypertarget{class_qore_1_1_h_t_t_p_client}{}\section{Qore\+:\+:H\+T\+T\+P\+Client Class Reference}
\label{class_qore_1_1_h_t_t_p_client}\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}


The \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} class can be used to communicate with H\+T\+TP servers with and without T\+L\+S/\+S\+SL encryption.  




Inheritance diagram for Qore\+:\+:H\+T\+T\+P\+Client\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=180pt]{class_qore_1_1_h_t_t_p_client__inherit__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ad7688922670e2c8795a1ee680a2d51e3}{clear\+Proxy\+U\+RL}} ()
\begin{DoxyCompactList}\small\item\em Clears the new proxy U\+RL value for the next connection. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ad555d0d81c335bb51820585b98888c12}{clear\+Proxy\+User\+Password}} ()
\begin{DoxyCompactList}\small\item\em Clears the username and password for the next proxy connection. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a626dc7ce23d1f0e2d7f02e3c8499f8f9}{clear\+Stats}} ()
\begin{DoxyCompactList}\small\item\em Clears performance statistics. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a9759d21c503bea0563dd8eaf6d6cfbd1}{clear\+User\+Password}} ()
\begin{DoxyCompactList}\small\item\em Clears the username and password for the connection. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a4102b502a8be8262eecea4e0a85ebe5b}{clear\+Warning\+Queue}} ()
\begin{DoxyCompactList}\small\item\em Removes any warning \mbox{\hyperlink{class_qore_1_1_thread_1_1_queue}{Queue}} object from the \mbox{\hyperlink{class_qore_1_1_socket}{Socket}}. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a6df282a9db795b68ac5332f2429c4e8e}{connect}} ()
\begin{DoxyCompactList}\small\item\em Connects to the remote socket; S\+S\+L/\+T\+LS negotiation is performed if required. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_afaadae37160f803e2c0a6569f62173df}{constructor}} (\mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} opts)
\begin{DoxyCompactList}\small\item\em Creates the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} object based on the option parameter passed. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a1966daad73f8cd30da527e16618eb768}{constructor}} ()
\begin{DoxyCompactList}\small\item\em Creates the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} object. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_aa2aa9b3adf0a30ea41bc521ab240055b}{copy}} ()
\begin{DoxyCompactList}\small\item\em Copying objects of this class is not supported, an exception will be thrown. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ad8e70fc5524dfb8931f0bfab47326995}{destructor}} ()
\begin{DoxyCompactList}\small\item\em Destroys the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} object and closes any open connections. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_aeaa701096e2089dd42de81fb177730e9}{disconnect}} ()
\begin{DoxyCompactList}\small\item\em Disconnects from the remote socket if a connection is established (otherwise does nothing) \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a970d28332d49ae168e1fc0d8dd279564}{get}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} path, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} headers, \+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$ info)
\begin{DoxyCompactList}\small\item\em Sends an H\+T\+TP {\ttfamily G\+ET} request and returns the message body received as a string or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if no message body is received. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a7513f6c2118f0d8de7dd15cb8ddbc21b}{get\+Connect\+Timeout}} ()
\begin{DoxyCompactList}\small\item\em Returns the connect timeout as an integer in milliseconds. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a1d0fef0b049abca0d26c931c5e8f020b}{get\+Connection\+Path}} ()
\begin{DoxyCompactList}\small\item\em Returns the current connection path set in the U\+RL. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a2917c58f43d176b49075d6db1c517ea5}{get\+Default\+Path}} ()
\begin{DoxyCompactList}\small\item\em Returns the default path used by the object if no path is set in the U\+RL. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a913167ec6f9c386e67cc0178761b0f61}{get\+Encoding}} ()
\begin{DoxyCompactList}\small\item\em Returns the character encoding used for the object. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a4e2d0ff10616b7bba8a6ffe2b1cecd38}{get\+H\+T\+T\+P\+Version}} ()
\begin{DoxyCompactList}\small\item\em Returns the H\+T\+TP protocol version string used in outgoing messages. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_afbb1c7d48fc1b1dcba32e1051041bfae}{get\+Max\+Redirects}} ()
\begin{DoxyCompactList}\small\item\em Returns the current {\ttfamily max\+\_\+redirects} value for the object (the maximum number of H\+T\+TP redirects that will be processed before an exception is raised) \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a3f9632f945cdd1df380d2831e73c924b}{get\+No\+Delay}} ()
\begin{DoxyCompactList}\small\item\em Returns the {\ttfamily T\+C\+P\+\_\+\+N\+O\+D\+E\+L\+AY} setting for the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} object. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a3018d4114a87d90d914a0ed62e924e83}{get\+Proxy\+U\+RL}} ()
\begin{DoxyCompactList}\small\item\em Returns the current proxy U\+RL as a string or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if no proxy U\+RL is set. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ad8dea5c7fcbfbcdc3408f2d62922f3b1}{get\+Timeout}} ()
\begin{DoxyCompactList}\small\item\em Returns the default I/O timeout as an integer in milliseconds. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a9a9b553de7854b86ca978a8d10c3c9dd}{get\+U\+RL}} ()
\begin{DoxyCompactList}\small\item\em Returns the current U\+RL. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a562b9b56a02f27c35bcc8e8b46ed1bc3}{get\+Usage\+Info}} ()
\begin{DoxyCompactList}\small\item\em Returns performance statistics for the socket. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_aeccf117ab608213e2d06cc9e3743b19d}{head}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} path, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} headers, \+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$ info)
\begin{DoxyCompactList}\small\item\em Sends an H\+T\+TP {\ttfamily H\+E\+AD} request and returns as hash of the headers received. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_adbee3f312158d29d873527085eb48bea}{is\+Connected}} ()
\begin{DoxyCompactList}\small\item\em Returns \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} or \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}} giving the current connection state. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a04c2df5e6fca680874e388a093fa136a}{is\+Proxy\+Secure}} ()
\begin{DoxyCompactList}\small\item\em Returns the S\+S\+L/\+T\+LS flag for the next proxy connection. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a5654958c7d5ca1106b092f85230a78f1}{is\+Secure}} ()
\begin{DoxyCompactList}\small\item\em Returns \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} if the current connection is encrypted, \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}} if not. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a228268e04d51d8e37d7c649349c9e0ff}{post}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} path, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} body, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} headers, \+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$ info)
\begin{DoxyCompactList}\small\item\em Sends an H\+T\+TP {\ttfamily P\+O\+ST} request with a message body and returns the message body received as a string or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if no message body is received. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ad924875b8a8f7e57c75a43c73bc1f883}{post}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} path, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} body, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} headers, \+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$ info)
\begin{DoxyCompactList}\small\item\em Sends an H\+T\+TP {\ttfamily P\+O\+ST} request with a message body and returns the message body received as a string or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if no message body is received. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{send}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} body, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} method, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} path, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} headers, softbool getbody=\mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}, \+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$ info)
\begin{DoxyCompactList}\small\item\em Sends an H\+T\+TP request with the specified method and optional message body and returns headers and any body received as a response in a hash format. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a70e6c929d24b711362fc17817507e82c}{send}} (\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} body, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} method, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} path, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} headers, softbool getbody=\mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}, \+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$ info)
\begin{DoxyCompactList}\small\item\em Sends an H\+T\+TP request with the specified method and optional message body and returns headers and any body received as a response in a hash format. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_aaaacf1fe10f2affb6343600e123bd0bd}{send}} (\mbox{\hyperlink{class_qore_1_1_output_stream}{Qore\+::\+Output\+Stream}} os, \+\_\+\+\_\+7\+\_\+ data body, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} method, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} path, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} headers, timeout timeout\+\_\+ms=0, softbool getbody=\mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}, \+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$ info, \+\_\+\+\_\+7\+\_\+ code rcb)
\begin{DoxyCompactList}\small\item\em Sends an H\+T\+TP request with the specified method and optional message body; headers are returned through an optional receive callback and any body received is written to the \mbox{\hyperlink{class_qore_1_1_output_stream}{Output\+Stream}}. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_aa0b8e59ebd5518bfb4ec8a7d3e3f1e14}{send\+Chunked}} (\mbox{\hyperlink{class_qore_1_1_output_stream}{Qore\+::\+Output\+Stream}} os, \mbox{\hyperlink{class_qore_1_1_input_stream}{Qore\+::\+Input\+Stream}} is, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} method, \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} max\+\_\+chunk\+\_\+size=4096, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} path, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} headers, timeout timeout\+\_\+ms=0, softbool getbody=\mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}, \+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$ info, \+\_\+\+\_\+7\+\_\+ code rcb, \+\_\+\+\_\+7\+\_\+ code tcb)
\begin{DoxyCompactList}\small\item\em Sends a chunked H\+T\+TP request with the specified method and message body; headers are returned through an optional receive callback and any body received is written to the \mbox{\hyperlink{class_qore_1_1_output_stream}{Output\+Stream}}. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ad28aeda6922927ee534ddc2b5a9d7528}{send\+With\+Callbacks}} (code scb, code rcb, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} method, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} path, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} headers, timeout timeout\+\_\+ms=0, softbool getbody=\mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}, \+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$ info)
\begin{DoxyCompactList}\small\item\em Sends an H\+T\+TP request with the specified method and chunked message body as given by a send callback; headers and any body received are returned through a receive callback. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_af175eaef12aedc1759dd0a9dd2965e9f}{send\+With\+Recv\+Callback}} (code rcb, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} body, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} method, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} path, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} headers, timeout timeout\+\_\+ms=0, softbool getbody=\mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}, \+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$ info)
\begin{DoxyCompactList}\small\item\em Sends an H\+T\+TP request with the specified method and optional message body; headers and any body received are returned through a receive callback. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a5cac0bbb948e6dea7de999fd7844e0b5}{send\+With\+Recv\+Callback}} (code rcb, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} body, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} method, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} path, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} headers, timeout timeout\+\_\+ms=0, softbool getbody=\mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}, \+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$ info)
\begin{DoxyCompactList}\small\item\em Sends an H\+T\+TP request with the specified method and optional message body; headers and any body received are returned through a receive callback. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_af9be5b81abf6192ea802e4c4cdecb284}{send\+With\+Send\+Callback}} (code scb, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} method, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} path, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} headers, timeout timeout\+\_\+ms=0, softbool getbody=\mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}, \+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$ info)
\begin{DoxyCompactList}\small\item\em Sends an H\+T\+TP request with the specified method and chunked message body as given by a send callback and returns headers and any body received as a response in a hash format. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a59c32a1cb1c23f5616a57c7b349521ef}{set\+Connect\+Timeout}} (timeout timeout\+\_\+ms=-\/1)
\begin{DoxyCompactList}\small\item\em Sets the connect timeout in milliseconds. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a7d57e49bdde9c6fa2d67013f3fb0a4c8}{set\+Default\+Path}} (\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} path)
\begin{DoxyCompactList}\small\item\em Sets the default path used by the object if no path is set in the U\+RL. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a79ec21def4e2015d6da8b2a5d71e9b0e}{set\+Encoding}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} encoding)
\begin{DoxyCompactList}\small\item\em Sets the string encoding for the object; any strings deserialized with this object will be tagged with this character encoding. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_af48e59604f6e7da844c79ac958b45f6a}{set\+Event\+Queue}} ()
\begin{DoxyCompactList}\small\item\em Clears any Queue object that may be set on the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} object so that \mbox{\hyperlink{event_handling}{I/O events}} are no longer captured on the object. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a1db25c4d7a84777c90e2cc44d5405212}{set\+Event\+Queue}} (\mbox{\hyperlink{class_qore_1_1_thread_1_1_queue}{Qore\+::\+Thread\+::\+Queue}} queue)
\begin{DoxyCompactList}\small\item\em Sets a Queue object to receive \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} and \mbox{\hyperlink{class_qore_1_1_socket}{Socket}} events. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a123efcd92e5d648856435f3fa445d620}{set\+H\+T\+T\+P\+Version}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} ver)
\begin{DoxyCompactList}\small\item\em Sets the H\+T\+TP protocol version string for headers in outgoing messages, allowed values are {\ttfamily \char`\"{}1.\+0\char`\"{}} and "1.\+1". \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_aea1c09e972256088465cacc56019906e}{set\+Max\+Redirects}} (softint mr=0)
\begin{DoxyCompactList}\small\item\em Updates the setting for the {\ttfamily max\+\_\+redirects} value for the object (maximum number of H\+T\+TP redirects that will be processed before an exception is raised) \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae6d797291f0f87d5243e40d2f8ea2bb7}{set\+No\+Delay}} (softbool b=\mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}})
\begin{DoxyCompactList}\small\item\em Sets the {\ttfamily T\+C\+P\+\_\+\+N\+O\+D\+E\+L\+AY} setting for the object. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a2e3bd5ea66d056b0a3f69b4d0e86964e}{set\+Persistent}} ()
\begin{DoxyCompactList}\small\item\em temporarily disables implicit reconnections; must be called when the server is already connected \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae58ff38024846050d5be3f6b36952c90}{set\+Proxy\+Secure}} (softbool b=\mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}})
\begin{DoxyCompactList}\small\item\em Sets the S\+S\+L/\+T\+LS flag for the next connection to the proxy. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_aef070595f39138c8d0d9f20ac47b6ac0}{set\+Proxy\+U\+RL}} ()
\begin{DoxyCompactList}\small\item\em Clears the new proxy U\+RL value for the next connection. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a27075d22526b650fdee997932cc1b658}{set\+Proxy\+U\+RL}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} url)
\begin{DoxyCompactList}\small\item\em Sets a new proxy U\+RL value for the next connection. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_afb6865d4b0d09a03f8688a1acbe5b320}{set\+Proxy\+User\+Password}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} user, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} pass)
\begin{DoxyCompactList}\small\item\em Sets the username and password for the connection to the proxy; call after \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_aef070595f39138c8d0d9f20ac47b6ac0}{H\+T\+T\+P\+Client\+::set\+Proxy\+U\+R\+L()}} \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_af4bccc6d03ff65bcd7e0a54c7b92e602}{set\+Proxy\+User\+Password}} ()
\begin{DoxyCompactList}\small\item\em Clears the username and password for the next proxy connection. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a5d0b8c0b6fe386efb42367d81cc20e51}{set\+Secure}} (softbool secure=\mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}})
\begin{DoxyCompactList}\small\item\em Sets the object to make a secure S\+S\+L/\+T\+LS connection on the next connect if the passed argument is \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}, or an unencrypted cleartext connection if it is \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_af55851848983f0c17a0ee2d217f6c198}{set\+Timeout}} (timeout timeout\+\_\+ms=0)
\begin{DoxyCompactList}\small\item\em Sets the default I/O timeout value in milliseconds. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a79d3f4dc0a39cd9afb1d30d5337e61e1}{set\+U\+RL}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} url)
\begin{DoxyCompactList}\small\item\em Sets a new U\+RL value for the next connection. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_aa02efa9f178f55a45da68a84bd824c71}{set\+User\+Password}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} user, \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} pass)
\begin{DoxyCompactList}\small\item\em Sets the username and password for the connection; call after \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a79d3f4dc0a39cd9afb1d30d5337e61e1}{H\+T\+T\+P\+Client\+::set\+U\+R\+L()}} \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ab612d8a6bec649e1252515b2e78d2150}{set\+User\+Password}} ()
\begin{DoxyCompactList}\small\item\em Clears the username and password for the connection. \end{DoxyCompactList}\item 
nothing \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae2aafddbf5be67012e3b57f846c4105e}{set\+Warning\+Queue}} (\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} warning\+\_\+ms, \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} warning\+\_\+bs, Queue queue, auto arg, timeout min\+\_\+ms=1s)
\begin{DoxyCompactList}\small\item\em Sets a \mbox{\hyperlink{class_qore_1_1_thread_1_1_queue}{Queue}} object to receive socket warnings. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
The \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} class can be used to communicate with H\+T\+TP servers with and without T\+L\+S/\+S\+SL encryption. 

\begin{DoxyParagraph}{Restrictions\+:}
\mbox{\hyperlink{group__parse__options_ga20400e83c6271a294a48b15a8f952efa}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+N\+E\+T\+W\+O\+RK}}
\end{DoxyParagraph}
The \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} class can be used to communicate with H\+T\+TP servers using the H\+T\+TP or H\+T\+T\+PS (H\+T\+TP using an S\+S\+L/\+T\+LS encrypted connection) protocol.

By default {\ttfamily \char`\"{}\+Connection\+: Keep-\/\+Alive\char`\"{}} is always sent regardless of the H\+T\+TP protocol level set for the object, however if a server response contains {\ttfamily \char`\"{}\+Connection\+: close\char`\"{}}, the connection will be closed as soon as the full response (including any message body if present) has been read.

H\+T\+TP redirect responses are supported and can be limited with the {\ttfamily max\+\_\+redirects} constructor hash key or by using the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_aea1c09e972256088465cacc56019906e}{H\+T\+T\+P\+Client\+::set\+Max\+Redirects()}} method. The default maximum number of redirects allowed is 5.

H\+T\+TP basic authentication is supported; set the username and password in the U\+RL (ex\+: {\ttfamily \char`\"{}http\+://username\+:password@host\+:port/path\char`\"{}}). To change the U\+RL from the one set by the constructor, call \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a79d3f4dc0a39cd9afb1d30d5337e61e1}{H\+T\+T\+P\+Client\+::set\+U\+R\+L()}}.

H\+T\+TP proxies and basic proxy authentication are supported by setting the proxy constructor hash key to the proxy U\+RL (with a proxy username and password if required) or by calling the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_aef070595f39138c8d0d9f20ac47b6ac0}{H\+T\+T\+P\+Client\+::set\+Proxy\+U\+R\+L()}} method.

Objects of this class are thread-\/safe and support serializing multiple simultaneous requests from many threads. If a request is in progress and another thread attempts to make a request at the same time, the second thread will block until the first is complete. Therefore the total amount of time a thread could wait for a response in a multi-\/threaded context could be greater than the timeout value (which applies to the maximum time a single internal \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{send()}} or \mbox{\hyperlink{class_qore_1_1_socket_adba4badd712c161df1b2da87e528ecb8}{recv()}} action can take).

This class understands and automatically decodes {\ttfamily \char`\"{}deflate\char`\"{}}, {\ttfamily \char`\"{}gzip\char`\"{}}, and {\ttfamily \char`\"{}bzip2\char`\"{}} content encodings as well.

The default I/O timeout value is 300,000 milliseconds (5 minutes). Note that the timeout value applies to individual internal \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{send()}} or \mbox{\hyperlink{class_qore_1_1_socket_adba4badd712c161df1b2da87e528ecb8}{recv()}} operations; for this reason for large transfers the overall I/O time could exceed the timeout value.

When an exception is thrown (for example, a response code of $<$ {\ttfamily 100} or $>$= {\ttfamily 400} is received from the server), any message body returned will be in the {\ttfamily \char`\"{}arg\char`\"{}} key of the exception hash.

This class understands the protocols in the following table.~\newline
~\newline
 {\bfseries H\+T\+T\+P\+Client Class Protocols}  \tabulinesep=1mm
\begin{longtabu} spread 0pt [c]{*{4}{|X[-1]}|}
\hline
{\bfseries Protocol/\+Scheme} &{\bfseries Default Port} &{\bfseries S\+SL?} &{\bfseries Description}  \\\cline{1-4}
{\ttfamily http}  &{\ttfamily 80}  &No &Unencrypted H\+T\+TP protocol  \\\cline{1-4}
{\ttfamily https}  &{\ttfamily 443}  &Yes &H\+T\+TP protocol with S\+S\+L/\+T\+LS encryption  \\\cline{1-4}
\end{longtabu}


Whenever using an \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} method where a hash of headers can be passed to the method, some headers are generated by default by the class and can be overridden, and some are cannot be overridden and are ignored if passed by the client. See the following tables for details.

{\bfseries H\+T\+T\+P\+Client Mandatory Headers}  \tabulinesep=1mm
\begin{longtabu} spread 0pt [c]{*{2}{|X[-1]}|}
\hline
{\bfseries Header} &{\bfseries Description}  \\\cline{1-2}
{\ttfamily Content-\/\+Length}  &This header is only sent if a message body is sent, and, if so, the length is calculated automatically.  \\\cline{1-2}
\end{longtabu}


{\bfseries H\+T\+T\+P\+Client Default, but Overridable Headers}  \tabulinesep=1mm
\begin{longtabu} spread 0pt [c]{*{2}{|X[-1]}|}
\hline
{\bfseries Header} &{\bfseries Default Value}  \\\cline{1-2}
{\ttfamily Accept}  &{\ttfamily \char`\"{}text/html\char`\"{}}   \\\cline{1-2}
{\ttfamily Content-\/\+Type}  &{\ttfamily \char`\"{}text/html\char`\"{}}   \\\cline{1-2}
{\ttfamily User-\/\+Agent}  &{\ttfamily \char`\"{}\+Qore-\/\+H\+T\+T\+P-\/\+Client/0.\+8.\+8\char`\"{}}   \\\cline{1-2}
{\ttfamily Connection}  &{\ttfamily \char`\"{}\+Keep-\/\+Alive\char`\"{}}   \\\cline{1-2}
{\ttfamily Accept-\/\+Encoding}  &{\ttfamily \char`\"{}gzip,deflate,bzip2\char`\"{}}   \\\cline{1-2}
\end{longtabu}


This class supports posting network events to a \mbox{\hyperlink{class_qore_1_1_thread_1_1_queue}{Queue}}. See \mbox{\hyperlink{event_handling}{I/O Event Handling}} for more information.

The events raised by this object are listed in the following table\+: {\bfseries \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} Events}  \tabulinesep=1mm
\begin{longtabu} spread 0pt [c]{*{2}{|X[-1]}|}
\hline
{\bfseries Name} &{\bfseries Description}  \\\cline{1-2}
\mbox{\hyperlink{event_handling_EVENT_HTTP_CONTENT_LENGTH}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+C\+O\+N\+T\+E\+N\+T\+\_\+\+L\+E\+N\+G\+TH}} &Raised when the H\+T\+TP {\ttfamily \char`\"{}\+Content-\/\+Length\char`\"{}} header is received.  \\\cline{1-2}
\mbox{\hyperlink{event_handling_EVENT_HTTP_CHUNKED_START}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+C\+H\+U\+N\+K\+E\+D\+\_\+\+S\+T\+A\+RT}} &Raised when H\+T\+TP chunked data is about to be received.  \\\cline{1-2}
\mbox{\hyperlink{event_handling_EVENT_HTTP_CHUNKED_END}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+C\+H\+U\+N\+K\+E\+D\+\_\+\+E\+ND}} &Raised when all H\+T\+TP chunked data has been received.  \\\cline{1-2}
\mbox{\hyperlink{event_handling_EVENT_HTTP_REDIRECT}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+R\+E\+D\+I\+R\+E\+CT}} &Raised when an H\+T\+TP redirect message is received.  \\\cline{1-2}
\mbox{\hyperlink{event_handling_EVENT_HTTP_SEND_MESSAGE}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+S\+E\+N\+D\+\_\+\+M\+E\+S\+S\+A\+GE}} &Raised when an H\+T\+TP message is sent.  \\\cline{1-2}
\mbox{\hyperlink{event_handling_EVENT_HTTP_MESSAGE_RECEIVED}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+M\+E\+S\+S\+A\+G\+E\+\_\+\+R\+E\+C\+E\+I\+V\+ED}} &Raised when an H\+T\+TP message is received.  \\\cline{1-2}
\mbox{\hyperlink{event_handling_EVENT_HTTP_FOOTERS_RECEIVED}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+F\+O\+O\+T\+E\+R\+S\+\_\+\+R\+E\+C\+E\+I\+V\+ED}} &Raised when H\+T\+TP footers are received.  \\\cline{1-2}
\mbox{\hyperlink{event_handling_EVENT_HTTP_CHUNKED_DATA_RECEIVED}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+C\+H\+U\+N\+K\+E\+D\+\_\+\+D\+A\+T\+A\+\_\+\+R\+E\+C\+E\+I\+V\+ED}} &Raised when a block of H\+T\+TP chunked data is received.  \\\cline{1-2}
\mbox{\hyperlink{event_handling_EVENT_HTTP_CHUNK_SIZE}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+C\+H\+U\+N\+K\+\_\+\+S\+I\+ZE}} &Raised when the next chunk size for H\+T\+TP chunked data is known.  \\\cline{1-2}
\end{longtabu}
\hypertarget{class_qore_1_1_h_t_t_p_client_httpclient_get_with_body}{}\subsection{H\+T\+T\+P G\+E\+T Requests With a Message Body}\label{class_qore_1_1_h_t_t_p_client_httpclient_get_with_body}
The Qore \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} class allows {\ttfamily G\+ET} requests to be made with a message body, however please note that this is a bad practice according to H\+T\+TP 1.\+1 R\+F\+Cs; specifically\+:
\begin{DoxyItemize}
\item \href{https://tools.ietf.org/html/rfc2616#section-4.3}{\tt R\+FC 2616 section 4.\+3}\+: \begin{DoxyVerb}if the request method does not include defined semantics for an entity-body,
then the message-body SHOULD be ignored when handling the request.\end{DoxyVerb}

\item \href{https://tools.ietf.org/html/rfc7231#section-4.3.1}{\tt R\+FC 7231 section 4.\+3.\+1}\+: \begin{DoxyVerb}A payload within a GET request message has no defined semantics; sending a
payload body on a GET request might cause some existing implementations to
reject the request.\end{DoxyVerb}

\end{DoxyItemize}Therefore we can conclude that {\ttfamily G\+ET} methods do not include defined semantics, and therefore message bodies included with {\ttfamily G\+ET} requests {\ttfamily S\+H\+O\+U\+LD} be ignored according to the H\+T\+TP 1.\+1 spec, therefore it\textquotesingle{}s recommended not to send a message body with a {\ttfamily G\+ET} request if standards compliance and compatibility is a goal.

\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item This class is not available with the \mbox{\hyperlink{group__parse__options_ga20400e83c6271a294a48b15a8f952efa}{P\+O\+\_\+\+N\+O\+\_\+\+N\+E\+T\+W\+O\+RK}} parse option.
\item U\+R\+Ls with U\+N\+IX sockets are generally supported in \mbox{\hyperlink{namespace_qore}{Qore}} with the following syntax\+: {\ttfamily {\bfseries scheme\+://socket=}}{\itshape url\+\_\+encoded\+\_\+path}{\ttfamily {\bfseries /path}}, where {\itshape url\+\_\+encoded\+\_\+path} is a path with U\+R\+L-\/encoding as performed by \mbox{\hyperlink{group__misc__functions_ga639fba8c278c69ac4d4190ca1db19235}{encode\+\_\+url(string, True)}}; for example\+: {\ttfamily \char`\"{}http\+://socket=\%2ftmp\%socket-\/dir\%2fsocket-\/file-\/1/url/path\char`\"{}}; this allows a filesystem path to be used in the host portion of the U\+RL and for the U\+RL to include a U\+RL path as well.
\item H\+T\+TP headers should accept data in I\+S\+O-\/8859-\/1 (L\+A\+T\+I\+N-\/1) encoding, but in practice for maximum compatibility U\+S-\/\+A\+S\+C\+II should be used with any non-\/\+A\+S\+C\+II characters encoded with M\+I\+ME encoded-\/word format according to \href{https://tools.ietf.org/html/rfc2047}{\tt R\+FC 2047}. This class currently only performs character encoding conversion on strings used as the message body.
\item The default character encoding for this class is the same as the \mbox{\hyperlink{character_encoding_default_encoding}{default character encoding}} for Qore (normally {\ttfamily U\+T\+F-\/8}); this class does not include a {\ttfamily \char`\"{};charset=utf-\/8\char`\"{}} in the {\ttfamily \char`\"{}\+Content-\/\+Type\char`\"{}} header by default; this must be set explicitly by users of this class if necessary. 
\end{DoxyItemize}
\end{DoxyNote}


\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_ad7688922670e2c8795a1ee680a2d51e3}\label{class_qore_1_1_h_t_t_p_client_ad7688922670e2c8795a1ee680a2d51e3}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!clear\+Proxy\+U\+RL@{clear\+Proxy\+U\+RL}}
\index{clear\+Proxy\+U\+RL@{clear\+Proxy\+U\+RL}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{clear\+Proxy\+U\+R\+L()}{clearProxyURL()}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::clear\+Proxy\+U\+RL (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Clears the new proxy U\+RL value for the next connection. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.setProxyURL();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_ad555d0d81c335bb51820585b98888c12}\label{class_qore_1_1_h_t_t_p_client_ad555d0d81c335bb51820585b98888c12}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!clear\+Proxy\+User\+Password@{clear\+Proxy\+User\+Password}}
\index{clear\+Proxy\+User\+Password@{clear\+Proxy\+User\+Password}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{clear\+Proxy\+User\+Password()}{clearProxyUserPassword()}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::clear\+Proxy\+User\+Password (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Clears the username and password for the next proxy connection. 

Call this method after calling \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_aef070595f39138c8d0d9f20ac47b6ac0}{H\+T\+T\+P\+Client\+::set\+Proxy\+U\+R\+L()}} to clear any proxy authentication information present in the U\+RL used in \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_aef070595f39138c8d0d9f20ac47b6ac0}{H\+T\+T\+P\+Client\+::set\+Proxy\+U\+R\+L()}}

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.clearProxyUserPassword();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a626dc7ce23d1f0e2d7f02e3c8499f8f9}\label{class_qore_1_1_h_t_t_p_client_a626dc7ce23d1f0e2d7f02e3c8499f8f9}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!clear\+Stats@{clear\+Stats}}
\index{clear\+Stats@{clear\+Stats}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{clear\+Stats()}{clearStats()}}
{\footnotesize\ttfamily Qore\+::\+H\+T\+T\+P\+Client\+::clear\+Stats (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Clears performance statistics. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.clearStats();
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySince}{Since}
\mbox{\hyperlink{namespace_qore}{Qore}} 0.\+8.\+9
\end{DoxySince}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a562b9b56a02f27c35bcc8e8b46ed1bc3}{H\+T\+T\+P\+Client\+::get\+Usage\+Info()}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a9759d21c503bea0563dd8eaf6d6cfbd1}\label{class_qore_1_1_h_t_t_p_client_a9759d21c503bea0563dd8eaf6d6cfbd1}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!clear\+User\+Password@{clear\+User\+Password}}
\index{clear\+User\+Password@{clear\+User\+Password}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{clear\+User\+Password()}{clearUserPassword()}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::clear\+User\+Password (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Clears the username and password for the connection. 

Call this method after calling \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a79d3f4dc0a39cd9afb1d30d5337e61e1}{H\+T\+T\+P\+Client\+::set\+U\+R\+L()}} to clear any authentication information present in the U\+RL used in \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a79d3f4dc0a39cd9afb1d30d5337e61e1}{H\+T\+T\+P\+Client\+::set\+U\+R\+L()}}

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.clearUserPassword();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a4102b502a8be8262eecea4e0a85ebe5b}\label{class_qore_1_1_h_t_t_p_client_a4102b502a8be8262eecea4e0a85ebe5b}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!clear\+Warning\+Queue@{clear\+Warning\+Queue}}
\index{clear\+Warning\+Queue@{clear\+Warning\+Queue}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{clear\+Warning\+Queue()}{clearWarningQueue()}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::clear\+Warning\+Queue (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Removes any warning \mbox{\hyperlink{class_qore_1_1_thread_1_1_queue}{Queue}} object from the \mbox{\hyperlink{class_qore_1_1_socket}{Socket}}. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.clearWarningQueue();
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae2aafddbf5be67012e3b57f846c4105e}{H\+T\+T\+P\+Client\+::set\+Warning\+Queue()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
\mbox{\hyperlink{namespace_qore}{Qore}} 0.\+8.\+9 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a6df282a9db795b68ac5332f2429c4e8e}\label{class_qore_1_1_h_t_t_p_client_a6df282a9db795b68ac5332f2429c4e8e}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!connect@{connect}}
\index{connect@{connect}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{connect()}{connect()}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::connect (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Connects to the remote socket; S\+S\+L/\+T\+LS negotiation is performed if required. 

If the protocol indicates that a secure connection should be established (or \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a5d0b8c0b6fe386efb42367d81cc20e51}{H\+T\+T\+P\+Client\+::set\+Secure()}} was called previsouly), S\+S\+L/\+T\+LS negotiation will be attempted.

If the {\ttfamily T\+C\+P\+\_\+\+N\+O\+D\+E\+L\+AY} flag has been set (see \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae6d797291f0f87d5243e40d2f8ea2bb7}{H\+T\+T\+P\+Client\+::set\+No\+Delay()}}), then after a successful connection to the remote socket, this option will be set on the socket. If an error occurs setting the {\ttfamily T\+C\+P\+\_\+\+N\+O\+D\+E\+L\+AY} option, the internal flag is set to false (use \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a3f9632f945cdd1df380d2831e73c924b}{H\+T\+T\+P\+Client\+::get\+No\+Delay()}} to check the flag\textquotesingle{}s state) and the error code can be retrieved with \mbox{\hyperlink{group__library__functions_gabcf45c25ca1234fc8c54761750324cda}{errno()}}.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.connect();
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyParagraph}{Events\+:}
\mbox{\hyperlink{event_handling_EVENT_CONNECTING}{E\+V\+E\+N\+T\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+NG}}, \mbox{\hyperlink{event_handling_EVENT_CONNECTED}{E\+V\+E\+N\+T\+\_\+\+C\+O\+N\+N\+E\+C\+T\+ED}}, \mbox{\hyperlink{event_handling_EVENT_HOSTNAME_LOOKUP}{E\+V\+E\+N\+T\+\_\+\+H\+O\+S\+T\+N\+A\+M\+E\+\_\+\+L\+O\+O\+K\+UP}}, \mbox{\hyperlink{event_handling_EVENT_HOSTNAME_RESOLVED}{E\+V\+E\+N\+T\+\_\+\+H\+O\+S\+T\+N\+A\+M\+E\+\_\+\+R\+E\+S\+O\+L\+V\+ED}}, \mbox{\hyperlink{event_handling_EVENT_START_SSL}{E\+V\+E\+N\+T\+\_\+\+S\+T\+A\+R\+T\+\_\+\+S\+SL}}, \mbox{\hyperlink{event_handling_EVENT_SSL_ESTABLISHED}{E\+V\+E\+N\+T\+\_\+\+S\+S\+L\+\_\+\+E\+S\+T\+A\+B\+L\+I\+S\+H\+ED}}
\end{DoxyParagraph}
\begin{DoxyNote}{Note}
For possible exceptions, see the \mbox{\hyperlink{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b}{Socket\+::connect()}} method (or \mbox{\hyperlink{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5}{Socket\+::connect\+S\+S\+L()}} for secure connections). 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_afaadae37160f803e2c0a6569f62173df}\label{class_qore_1_1_h_t_t_p_client_afaadae37160f803e2c0a6569f62173df}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!constructor@{constructor}}
\index{constructor@{constructor}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{constructor()}{constructor()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily Qore\+::\+H\+T\+T\+P\+Client\+::constructor (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}}}]{opts }\end{DoxyParamCaption})}



Creates the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} object based on the option parameter passed. 

To connect, call any method that requires a connection and an implicit connection is established, or call \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a6df282a9db795b68ac5332f2429c4e8e}{H\+T\+T\+P\+Client\+::connect()}}.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
HTTPClient httpclient((\textcolor{stringliteral}{"url"}:\textcolor{stringliteral}{"http://hostname:8080/path"}));
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em opts} & sets options and changes default behaviour for the object, etc; key names are case-\/sensitive and therefore must all be in lower-\/case\+:
\begin{DoxyItemize}
\item {\ttfamily additional\+\_\+methods\+:} An optional hash defining additional H\+T\+TP methods to handle. This allows the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} class to handle various H\+T\+TP extensions like e.\+g. Web\+D\+AV. The hash is defined with new method names as keys; the values are \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} or \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}} indicating if the method can accept a message body; for example\+: 
\begin{DoxyCode}
\textcolor{comment}{# add two new HTTP methods for WebDAV; both require message bodies}
HTTPClient httpclient((\textcolor{stringliteral}{"url"}: url, \textcolor{stringliteral}{"additional\_methods"}: (\textcolor{stringliteral}{"PROPFIND"}: \textcolor{keyword}{True}, \textcolor{stringliteral}{"MKCOL"}: \textcolor{keyword}{True} )));
\end{DoxyCode}

\item {\ttfamily connect\+\_\+timeout\+:} The timeout value in milliseconds for establishing a new socket connection (also can be a \mbox{\hyperlink{basic_data_types_relative_dates}{relative date-\/time value}} for clarity, ex\+: {\ttfamily 30s})
\item {\ttfamily default\+\_\+path\+:} The default path to use for new connections if a path is not otherwise specified in the connection U\+RL
\item {\ttfamily default\+\_\+port\+:} The default port number to connect to if none is given in the U\+RL
\item {\ttfamily http\+\_\+version\+:} Either {\ttfamily \char`\"{}1.\+0\char`\"{}} or {\ttfamily \char`\"{}1.\+1\char`\"{}} for the claimed H\+T\+TP protocol version compliancy in outgoing message headers
\item {\ttfamily max\+\_\+redirects\+:} The maximum number of redirects before throwing an exception (the default is 5)
\item {\ttfamily protocols\+:} A hash describing new protocols, the key is the protocol name and the value is either an integer giving the default port number or a hash with {\ttfamily \char`\"{}port\char`\"{}} and {\ttfamily \char`\"{}ssl\char`\"{}} keys giving the default port number and a boolean value to indicate that an S\+SL connection should be established
\item {\ttfamily proxy\+:} The proxy U\+RL for connecting through a proxy
\item {\ttfamily ssl\+\_\+cert\+\_\+path\+:} a path to an X.\+509 client certificate file in P\+EM format; if this option is used, then the calling context must not be restricted with sandbox restriction \mbox{\hyperlink{group__parse__options_ga5e466ed886222f0b57b0a399b455be71}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+F\+I\+L\+E\+S\+Y\+S\+T\+EM}} which is checked at runtime
\item {\ttfamily ssl\+\_\+key\+\_\+path\+:} a path to a private key file in P\+EM format for the X.\+509 client certificate; if this option is used, then the calling context must not be restricted with sandbox restriction \mbox{\hyperlink{group__parse__options_ga5e466ed886222f0b57b0a399b455be71}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+F\+I\+L\+E\+S\+Y\+S\+T\+EM}} which is checked at runtime
\item {\ttfamily ssl\+\_\+key\+\_\+password\+:} the password to the private key given with {\ttfamily ssl\+\_\+key\+\_\+path} 
\item {\ttfamily ssl\+\_\+verify\+\_\+cert\+:} if \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} then the server\textquotesingle{}s certificate will only be accepted if it\textquotesingle{}s verified
\item {\ttfamily timeout\+:} The timeout value in milliseconds (also can be a \mbox{\hyperlink{basic_data_types_relative_dates}{relative date-\/time value}} for clarity, ex\+: {\ttfamily 5m})
\item {\ttfamily url\+:} A string giving the U\+RL to connect to
\end{DoxyItemize}\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+O\+P\+T\+I\+O\+N-\/\+E\+R\+R\+OR} & invalid or unknown option passed in option hash \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+U\+R\+L-\/\+E\+R\+R\+OR} & invalid U\+RL string \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+U\+N\+K\+N\+O\+W\+N-\/\+P\+R\+O\+T\+O\+C\+OL} & unknown protocol passed in U\+RL \\
\hline
{\em I\+L\+L\+E\+G\+A\+L-\/\+F\+I\+L\+E\+S\+Y\+S\+T\+E\+M-\/\+A\+C\+C\+E\+SS} & if the calling context is restricted with the \mbox{\hyperlink{group__parse__options_ga5e466ed886222f0b57b0a399b455be71}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+F\+I\+L\+E\+S\+Y\+S\+T\+EM}} sandboxing restriction and one of the following options is used\+: {\ttfamily ssl\+\_\+cert\+\_\+path} or {\ttfamily ssl\+\_\+key\+\_\+path} \\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item U\+R\+Ls with U\+N\+IX sockets are generally supported in \mbox{\hyperlink{namespace_qore}{Qore}} with the following syntax\+: {\ttfamily {\bfseries scheme\+://socket=}}{\itshape url\+\_\+encoded\+\_\+path}{\ttfamily {\bfseries /path}}, where {\itshape url\+\_\+encoded\+\_\+path} is a path with U\+R\+L-\/encoding as performed by \mbox{\hyperlink{group__misc__functions_ga639fba8c278c69ac4d4190ca1db19235}{encode\+\_\+url(string, True)}}; for example\+: {\ttfamily \char`\"{}http\+://socket=\%2ftmp\%socket-\/dir\%2fsocket-\/file-\/1/url/path\char`\"{}}; this allows a filesystem path to be used in the host portion of the U\+RL and for the U\+RL to include a U\+RL path as well.
\item other I/O errors can be thrown opening and reading the certificate and/or private key files if the {\ttfamily ssl\+\_\+cert\+\_\+path} or {\ttfamily ssl\+\_\+key\+\_\+path} options are used
\item the \mbox{\hyperlink{group__parse__options_ga5e466ed886222f0b57b0a399b455be71}{Qore\+::\+P\+O\+\_\+\+N\+O\+\_\+\+F\+I\+L\+E\+S\+Y\+S\+T\+EM}} sandbox restriction is checked at runtime if one of the following options is used\+: {\ttfamily ssl\+\_\+cert\+\_\+path} or {\ttfamily ssl\+\_\+key\+\_\+path} 
\end{DoxyItemize}
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 added the following options\+:
\begin{DoxyItemize}
\item {\ttfamily ssl\+\_\+cert\+\_\+path} 
\item {\ttfamily ssl\+\_\+key\+\_\+path} 
\item {\ttfamily ssl\+\_\+key\+\_\+password} 
\item {\ttfamily ssl\+\_\+verify\+\_\+cert} 
\end{DoxyItemize}
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a1966daad73f8cd30da527e16618eb768}\label{class_qore_1_1_h_t_t_p_client_a1966daad73f8cd30da527e16618eb768}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!constructor@{constructor}}
\index{constructor@{constructor}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{constructor()}{constructor()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily Qore\+::\+H\+T\+T\+P\+Client\+::constructor (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Creates the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} object. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
HTTPClient httpclient();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_aa2aa9b3adf0a30ea41bc521ab240055b}\label{class_qore_1_1_h_t_t_p_client_aa2aa9b3adf0a30ea41bc521ab240055b}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!copy@{copy}}
\index{copy@{copy}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{copy()}{copy()}}
{\footnotesize\ttfamily Qore\+::\+H\+T\+T\+P\+Client\+::copy (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Copying objects of this class is not supported, an exception will be thrown. 


\begin{DoxyExceptions}{Exceptions}
{\em H\+T\+T\+P\+C\+L\+I\+E\+N\+T-\/\+C\+O\+P\+Y-\/\+E\+R\+R\+OR} & copying \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} objects is not yet supported \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_ad8e70fc5524dfb8931f0bfab47326995}\label{class_qore_1_1_h_t_t_p_client_ad8e70fc5524dfb8931f0bfab47326995}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!destructor@{destructor}}
\index{destructor@{destructor}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{destructor()}{destructor()}}
{\footnotesize\ttfamily Qore\+::\+H\+T\+T\+P\+Client\+::destructor (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Destroys the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} object and closes any open connections. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
delete httpclient;
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_aeaa701096e2089dd42de81fb177730e9}\label{class_qore_1_1_h_t_t_p_client_aeaa701096e2089dd42de81fb177730e9}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!disconnect@{disconnect}}
\index{disconnect@{disconnect}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{disconnect()}{disconnect()}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::disconnect (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Disconnects from the remote socket if a connection is established (otherwise does nothing) 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.disconnect();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a970d28332d49ae168e1fc0d8dd279564}\label{class_qore_1_1_h_t_t_p_client_a970d28332d49ae168e1fc0d8dd279564}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!get@{get}}
\index{get@{get}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{get()}{get()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+H\+T\+T\+P\+Client\+::get (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{path,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}}}]{headers,  }\item[{\+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$}]{info }\end{DoxyParamCaption})}



Sends an H\+T\+TP {\ttfamily G\+ET} request and returns the message body received as a string or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if no message body is received. 

In order to get the headers and the body, use the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{H\+T\+T\+P\+Client\+::send()}} method instead (although note that sending an H\+T\+TP message bosdy with a {\ttfamily G\+ET} request is not standards compliant; see \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_httpclient_get_with_body}{H\+T\+TP G\+ET Requests With a Message Body}} for more information).

If no connection has already been established, an internal call to \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a6df282a9db795b68ac5332f2429c4e8e}{H\+T\+T\+P\+Client\+::connect()}} will be made before sending the request.

If any content encoding is used for the message body in the reply, the content is decoded and returned as a string; if the content encoding uses an unknown method, then an exception is thrown.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
*string html = httpclient.get(\textcolor{stringliteral}{"/path/file.html"});
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em path} & the path for the message (i.\+e. {\ttfamily \char`\"{}/path/resource?method\&param=value\char`\"{}}) \\
\hline
{\em headers} & An optional hash of headers to include in the message; values are converted to strings; a list is converted to a string of comma-\/separated values; headers that differ only in case will be overwritten by the last header in the hash with a matching name with a case-\/insensitive search \\
\hline
{\em info} & an optional reference to an lvalue that will be used as an output variable giving a hash of request headers and other information about the H\+T\+TP request; this hash contains the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily accept-\/charset}\+: this key will be set to an appropriate value from any {\ttfamily \char`\"{}\+Accept-\/\+Charset\char`\"{}} header; if any of {\ttfamily \char`\"{}$\ast$\char`\"{}}, {\ttfamily \char`\"{}utf8\char`\"{}}, or {\ttfamily \char`\"{}utf-\/8\char`\"{}} are present, then this will be set to {\ttfamily \char`\"{}utf8\char`\"{}}, otherwise it will be set to the first requested character encoding in the list
\item {\ttfamily charset\+:} if there is a {\ttfamily \char`\"{}charset\char`\"{}} declaration in the {\ttfamily \char`\"{}\+Content-\/\+Type\char`\"{}} header, the value is returned in this key
\item {\ttfamily body-\/content-\/type}\+: the outgoing message body M\+I\+ME {\ttfamily Content-\/\+Type} value
\item {\ttfamily headers\+:} a hash of outgoing H\+T\+TP request headers (returned as sent, without any case conversions)
\item {\ttfamily request-\/uri}\+: the request U\+RI string sent (ex\+: {\ttfamily \char`\"{}\+G\+E\+T /services/async/38.\+0/job H\+T\+T\+P/1.\+1\char`\"{}})
\item {\ttfamily request-\/body}\+: the raw message body in the request (before any content encoding)
\item {\ttfamily response-\/body}\+: the raw message body in the response (after any content decoding)
\item {\ttfamily response-\/headers}\+: a hash of incoming H\+T\+TP headers in the response with keys converted to all lower case for each header in the response message, plus the following Qore-\/provided keys\+:
\begin{DoxyItemize}
\item {\ttfamily http\+\_\+version\+:} the H\+T\+TP version in the response U\+RI
\item {\ttfamily status\+\_\+code\+:} the H\+T\+TP status code of the response
\item {\ttfamily status\+\_\+message\+:} the H\+T\+TP status message of the response
\end{DoxyItemize}
\item {\ttfamily response-\/uri}\+: the H\+T\+TP response U\+RI
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the message body in the reply to this message or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} in case of an error or an erroneous reply by the server with no body
\end{DoxyReturn}
\begin{DoxyParagraph}{Events\+:}
\mbox{\hyperlink{event_handling_EVENT_CONNECTING}{E\+V\+E\+N\+T\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+NG}}, \mbox{\hyperlink{event_handling_EVENT_CONNECTED}{E\+V\+E\+N\+T\+\_\+\+C\+O\+N\+N\+E\+C\+T\+ED}}, \mbox{\hyperlink{event_handling_EVENT_HOSTNAME_LOOKUP}{E\+V\+E\+N\+T\+\_\+\+H\+O\+S\+T\+N\+A\+M\+E\+\_\+\+L\+O\+O\+K\+UP}}, \mbox{\hyperlink{event_handling_EVENT_HOSTNAME_RESOLVED}{E\+V\+E\+N\+T\+\_\+\+H\+O\+S\+T\+N\+A\+M\+E\+\_\+\+R\+E\+S\+O\+L\+V\+ED}}, \mbox{\hyperlink{event_handling_EVENT_START_SSL}{E\+V\+E\+N\+T\+\_\+\+S\+T\+A\+R\+T\+\_\+\+S\+SL}}, \mbox{\hyperlink{event_handling_EVENT_SSL_ESTABLISHED}{E\+V\+E\+N\+T\+\_\+\+S\+S\+L\+\_\+\+E\+S\+T\+A\+B\+L\+I\+S\+H\+ED}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_SEND_MESSAGE}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+S\+E\+N\+D\+\_\+\+M\+E\+S\+S\+A\+GE}}, \mbox{\hyperlink{event_handling_EVENT_PACKET_SENT}{E\+V\+E\+N\+T\+\_\+\+P\+A\+C\+K\+E\+T\+\_\+\+S\+E\+NT}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_MESSAGE_RECEIVED}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+M\+E\+S\+S\+A\+G\+E\+\_\+\+R\+E\+C\+E\+I\+V\+ED}}, \mbox{\hyperlink{event_handling_EVENT_PACKET_READ}{E\+V\+E\+N\+T\+\_\+\+P\+A\+C\+K\+E\+T\+\_\+\+R\+E\+AD}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_CONTENT_LENGTH}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+C\+O\+N\+T\+E\+N\+T\+\_\+\+L\+E\+N\+G\+TH}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_CHUNKED_START}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+C\+H\+U\+N\+K\+E\+D\+\_\+\+S\+T\+A\+RT}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_CHUNKED_END}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+C\+H\+U\+N\+K\+E\+D\+\_\+\+E\+ND}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_CHUNKED_DATA_RECEIVED}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+C\+H\+U\+N\+K\+E\+D\+\_\+\+D\+A\+T\+A\+\_\+\+R\+E\+C\+E\+I\+V\+ED}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_CHUNK_SIZE}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+C\+H\+U\+N\+K\+\_\+\+S\+I\+ZE}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_FOOTERS_RECEIVED}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+F\+O\+O\+T\+E\+R\+S\+\_\+\+R\+E\+C\+E\+I\+V\+ED}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_REDIRECT}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+R\+E\+D\+I\+R\+E\+CT}}
\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+D\+I\+R\+E\+C\+T-\/\+E\+R\+R\+OR} & invalid redirect location given by remote \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+M\+A\+X\+I\+M\+U\+M-\/\+R\+E\+D\+I\+R\+E\+C\+T\+S-\/\+E\+X\+C\+E\+E\+D\+ED} & maximum redirect count exceeded \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+C\+E\+I\+V\+E-\/\+E\+R\+R\+OR} & unknown content encoding received or status error communicating with H\+T\+TP server (status code $<$ 100 or $>$ 299); in case of a status error the {\ttfamily \char`\"{}arg\char`\"{}} key of the exception hash will be set to a hash equal to the return value of the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{send()}} method including a {\ttfamily \char`\"{}status\+\_\+code\char`\"{}} key (giving the status code) and a {\ttfamily \char`\"{}body\char`\"{}} key (giving the message body returned by the server) \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+E\+N\+D-\/\+E\+R\+R\+OR} & There was an error sending the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+C\+L\+O\+S\+ED} & The remote end closed the connection \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+R\+E\+C\+V-\/\+E\+R\+R\+OR} & There was an error receiving the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+T\+I\+M\+E\+O\+UT} & Data transmission or reception for a single \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{send()}} or \mbox{\hyperlink{class_qore_1_1_socket_adba4badd712c161df1b2da87e528ecb8}{recv()}} action exceeded the timeout period \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+S\+L-\/\+E\+R\+R\+OR} & There was an S\+SL error while reading data from the socket \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+H\+T\+T\+P-\/\+E\+R\+R\+OR} & Invalid H\+T\+TP data was received\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
For possible exceptions when implicitly establishing a connection, see the \mbox{\hyperlink{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b}{Socket\+::connect()}} method (or \mbox{\hyperlink{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5}{Socket\+::connect\+S\+S\+L()}} for secure connections)
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_httpclient_get_with_body}{H\+T\+TP G\+ET Requests With a Message Body}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a1d0fef0b049abca0d26c931c5e8f020b}\label{class_qore_1_1_h_t_t_p_client_a1d0fef0b049abca0d26c931c5e8f020b}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!get\+Connection\+Path@{get\+Connection\+Path}}
\index{get\+Connection\+Path@{get\+Connection\+Path}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{get\+Connection\+Path()}{getConnectionPath()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+H\+T\+T\+P\+Client\+::get\+Connection\+Path (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the current connection path set in the U\+RL. 

\begin{DoxyReturn}{Returns}
the current connection path set in the U\+RL
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
*string path = httpclient.getConnectionPath();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a7513f6c2118f0d8de7dd15cb8ddbc21b}\label{class_qore_1_1_h_t_t_p_client_a7513f6c2118f0d8de7dd15cb8ddbc21b}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!get\+Connect\+Timeout@{get\+Connect\+Timeout}}
\index{get\+Connect\+Timeout@{get\+Connect\+Timeout}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{get\+Connect\+Timeout()}{getConnectTimeout()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+H\+T\+T\+P\+Client\+::get\+Connect\+Timeout (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the connect timeout as an integer in milliseconds. 

\begin{DoxyReturn}{Returns}
Returns the connect timeout as an integer in milliseconds; negative numbers mean the system default timeout is used
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
int to = httpclient.getConnectTimeout();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a2917c58f43d176b49075d6db1c517ea5}\label{class_qore_1_1_h_t_t_p_client_a2917c58f43d176b49075d6db1c517ea5}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!get\+Default\+Path@{get\+Default\+Path}}
\index{get\+Default\+Path@{get\+Default\+Path}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{get\+Default\+Path()}{getDefaultPath()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+H\+T\+T\+P\+Client\+::get\+Default\+Path (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the default path used by the object if no path is set in the U\+RL. 

\begin{DoxyReturn}{Returns}
the default path used by the object if no path is set in the U\+RL
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
*string def\_path = httpclient.getDefaultPath();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a913167ec6f9c386e67cc0178761b0f61}\label{class_qore_1_1_h_t_t_p_client_a913167ec6f9c386e67cc0178761b0f61}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!get\+Encoding@{get\+Encoding}}
\index{get\+Encoding@{get\+Encoding}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{get\+Encoding()}{getEncoding()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+H\+T\+T\+P\+Client\+::get\+Encoding (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the character encoding used for the object. 

\begin{DoxyReturn}{Returns}
the character encoding used for the object
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
string encoding = httpclient.getEncoding();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a4e2d0ff10616b7bba8a6ffe2b1cecd38}\label{class_qore_1_1_h_t_t_p_client_a4e2d0ff10616b7bba8a6ffe2b1cecd38}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!get\+H\+T\+T\+P\+Version@{get\+H\+T\+T\+P\+Version}}
\index{get\+H\+T\+T\+P\+Version@{get\+H\+T\+T\+P\+Version}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{get\+H\+T\+T\+P\+Version()}{getHTTPVersion()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+H\+T\+T\+P\+Client\+::get\+H\+T\+T\+P\+Version (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the H\+T\+TP protocol version string used in outgoing messages. 

\begin{DoxyReturn}{Returns}
the H\+T\+TP protocol version string used in outgoing messages
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
string version = httpclient.getHTTPVersion();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_afbb1c7d48fc1b1dcba32e1051041bfae}\label{class_qore_1_1_h_t_t_p_client_afbb1c7d48fc1b1dcba32e1051041bfae}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!get\+Max\+Redirects@{get\+Max\+Redirects}}
\index{get\+Max\+Redirects@{get\+Max\+Redirects}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{get\+Max\+Redirects()}{getMaxRedirects()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+H\+T\+T\+P\+Client\+::get\+Max\+Redirects (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the current {\ttfamily max\+\_\+redirects} value for the object (the maximum number of H\+T\+TP redirects that will be processed before an exception is raised) 

\begin{DoxyReturn}{Returns}
the current {\ttfamily max\+\_\+redirects} value for the object (the maximum number of H\+T\+TP redirects that will be processed before an exception is raised)
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
int mr = httpclient.getMaxRedirects();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a3f9632f945cdd1df380d2831e73c924b}\label{class_qore_1_1_h_t_t_p_client_a3f9632f945cdd1df380d2831e73c924b}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!get\+No\+Delay@{get\+No\+Delay}}
\index{get\+No\+Delay@{get\+No\+Delay}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{get\+No\+Delay()}{getNoDelay()}}
{\footnotesize\ttfamily bool Qore\+::\+H\+T\+T\+P\+Client\+::get\+No\+Delay (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the {\ttfamily T\+C\+P\+\_\+\+N\+O\+D\+E\+L\+AY} setting for the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} object. 

\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
bool b = httpclient.getNoDelay();
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}
also \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae6d797291f0f87d5243e40d2f8ea2bb7}{H\+T\+T\+P\+Client\+::set\+No\+Delay()}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a3018d4114a87d90d914a0ed62e924e83}\label{class_qore_1_1_h_t_t_p_client_a3018d4114a87d90d914a0ed62e924e83}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!get\+Proxy\+U\+RL@{get\+Proxy\+U\+RL}}
\index{get\+Proxy\+U\+RL@{get\+Proxy\+U\+RL}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{get\+Proxy\+U\+R\+L()}{getProxyURL()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+H\+T\+T\+P\+Client\+::get\+Proxy\+U\+RL (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the current proxy U\+RL as a string or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if no proxy U\+RL is set. 

\begin{DoxyReturn}{Returns}
the current proxy U\+RL as a string or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if no proxy U\+RL is set
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
*string proxy\_url = httpclient.getProxyURL();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_ad8dea5c7fcbfbcdc3408f2d62922f3b1}\label{class_qore_1_1_h_t_t_p_client_ad8dea5c7fcbfbcdc3408f2d62922f3b1}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!get\+Timeout@{get\+Timeout}}
\index{get\+Timeout@{get\+Timeout}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{get\+Timeout()}{getTimeout()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+H\+T\+T\+P\+Client\+::get\+Timeout (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the default I/O timeout as an integer in milliseconds. 

\begin{DoxyReturn}{Returns}
the default I/O timeout as an integer in milliseconds; 0 means immediate timeout (when reading only returns data if it is already available), and negative numbers mean never timeout
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
int timeout = httpclient.getTimeout();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a9a9b553de7854b86ca978a8d10c3c9dd}\label{class_qore_1_1_h_t_t_p_client_a9a9b553de7854b86ca978a8d10c3c9dd}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!get\+U\+RL@{get\+U\+RL}}
\index{get\+U\+RL@{get\+U\+RL}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{get\+U\+R\+L()}{getURL()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+H\+T\+T\+P\+Client\+::get\+U\+RL (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the current U\+RL. 

\begin{DoxyReturn}{Returns}
the current U\+RL
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
*string url = httpclient.getURL();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a562b9b56a02f27c35bcc8e8b46ed1bc3}\label{class_qore_1_1_h_t_t_p_client_a562b9b56a02f27c35bcc8e8b46ed1bc3}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!get\+Usage\+Info@{get\+Usage\+Info}}
\index{get\+Usage\+Info@{get\+Usage\+Info}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{get\+Usage\+Info()}{getUsageInfo()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} Qore\+::\+H\+T\+T\+P\+Client\+::get\+Usage\+Info (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns performance statistics for the socket. 

\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
hash h = httpclient.getUsageInfo();
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
a hash with the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily \char`\"{}bytes\+\_\+sent\char`\"{}}\+: an integer giving the total amount of bytes sent
\item {\ttfamily \char`\"{}bytes\+\_\+recv\char`\"{}}\+: an integer giving the total amount of bytes received
\item {\ttfamily \char`\"{}us\+\_\+sent\char`\"{}}\+: an integer giving the total number of microseconds spent sending data
\item {\ttfamily \char`\"{}us\+\_\+recv\char`\"{}}\+: an integer giving the total number of microseconds spent receiving data
\item {\ttfamily \char`\"{}arg\char`\"{}}\+: (only if warning values have been set with \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae2aafddbf5be67012e3b57f846c4105e}{H\+T\+T\+P\+Client\+:\+:set\+Warning\+Queue()}}) the optional argument for warning hashes
\item {\ttfamily \char`\"{}timeout\char`\"{}}\+: (only if warning values have been set with \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae2aafddbf5be67012e3b57f846c4105e}{H\+T\+T\+P\+Client\+:\+:set\+Warning\+Queue()}}) the warning timeout in microseconds
\item {\ttfamily \char`\"{}min\+\_\+throughput\char`\"{}}\+: (only if warning values have been set with \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae2aafddbf5be67012e3b57f846c4105e}{H\+T\+T\+P\+Client\+:\+:set\+Warning\+Queue()}}) the minimum warning throughput in bytes/sec
\end{DoxyItemize}
\end{DoxyReturn}
\begin{DoxySince}{Since}
\mbox{\hyperlink{namespace_qore}{Qore}} 0.\+8.\+9
\end{DoxySince}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a626dc7ce23d1f0e2d7f02e3c8499f8f9}{H\+T\+T\+P\+Client\+::clear\+Stats()}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_aeccf117ab608213e2d06cc9e3743b19d}\label{class_qore_1_1_h_t_t_p_client_aeccf117ab608213e2d06cc9e3743b19d}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!head@{head}}
\index{head@{head}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{head()}{head()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} Qore\+::\+H\+T\+T\+P\+Client\+::head (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{path,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}}}]{headers,  }\item[{\+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$}]{info }\end{DoxyParamCaption})}



Sends an H\+T\+TP {\ttfamily H\+E\+AD} request and returns as hash of the headers received. 

If no connection is established, an internal call to \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a6df282a9db795b68ac5332f2429c4e8e}{H\+T\+T\+P\+Client\+::connect()}} will be made before sending the message.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
hash msg = httpclient.head(\textcolor{stringliteral}{"/path"});
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em path} & the path for the message (i.\+e. {\ttfamily \char`\"{}/path/resource?method\&param=value\char`\"{}}) \\
\hline
{\em headers} & An optional hash of headers to include in the message; values are converted to strings; a list is converted to a string of comma-\/separated values; headers that differ only in case will be overwritten by the last header in the hash with a matching name with a case-\/insensitive search \\
\hline
{\em info} & an optional reference to an lvalue that will be used as an output variable giving a hash of request headers and other information about the H\+T\+TP request; this hash contains the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily accept-\/charset}\+: this key will be set to an appropriate value from any {\ttfamily \char`\"{}\+Accept-\/\+Charset\char`\"{}} header; if any of {\ttfamily \char`\"{}$\ast$\char`\"{}}, {\ttfamily \char`\"{}utf8\char`\"{}}, or {\ttfamily \char`\"{}utf-\/8\char`\"{}} are present, then this will be set to {\ttfamily \char`\"{}utf8\char`\"{}}, otherwise it will be set to the first requested character encoding in the list
\item {\ttfamily charset\+:} if there is a {\ttfamily \char`\"{}charset\char`\"{}} declaration in the {\ttfamily \char`\"{}\+Content-\/\+Type\char`\"{}} header, the value is returned in this key
\item {\ttfamily body-\/content-\/type}\+: the outgoing message body M\+I\+ME {\ttfamily Content-\/\+Type} value
\item {\ttfamily headers\+:} a hash of outgoing H\+T\+TP request headers (returned as sent, without any case conversions)
\item {\ttfamily request-\/uri}\+: the request U\+RI string sent (ex\+: {\ttfamily \char`\"{}\+G\+E\+T /services/async/38.\+0/job H\+T\+T\+P/1.\+1\char`\"{}})
\item {\ttfamily request-\/body}\+: the raw message body in the request (before any content encoding)
\item {\ttfamily response-\/body}\+: the raw message body in the response (after any content decoding)
\item {\ttfamily response-\/headers}\+: a hash of incoming H\+T\+TP headers in the response with keys converted to all lower case for each header in the response message, plus the following Qore-\/provided keys\+:
\begin{DoxyItemize}
\item {\ttfamily http\+\_\+version\+:} the H\+T\+TP version in the response U\+RI
\item {\ttfamily status\+\_\+code\+:} the H\+T\+TP status code of the response
\item {\ttfamily status\+\_\+message\+:} the H\+T\+TP status message of the response
\end{DoxyItemize}
\item {\ttfamily response-\/uri}\+: the H\+T\+TP response U\+RI
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the headers received from the H\+T\+TP server with all key names converted to lower-\/case
\end{DoxyReturn}
\begin{DoxyParagraph}{Events\+:}
\mbox{\hyperlink{event_handling_EVENT_CONNECTING}{E\+V\+E\+N\+T\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+NG}}, \mbox{\hyperlink{event_handling_EVENT_CONNECTED}{E\+V\+E\+N\+T\+\_\+\+C\+O\+N\+N\+E\+C\+T\+ED}}, \mbox{\hyperlink{event_handling_EVENT_HOSTNAME_LOOKUP}{E\+V\+E\+N\+T\+\_\+\+H\+O\+S\+T\+N\+A\+M\+E\+\_\+\+L\+O\+O\+K\+UP}}, \mbox{\hyperlink{event_handling_EVENT_HOSTNAME_RESOLVED}{E\+V\+E\+N\+T\+\_\+\+H\+O\+S\+T\+N\+A\+M\+E\+\_\+\+R\+E\+S\+O\+L\+V\+ED}}, \mbox{\hyperlink{event_handling_EVENT_START_SSL}{E\+V\+E\+N\+T\+\_\+\+S\+T\+A\+R\+T\+\_\+\+S\+SL}}, \mbox{\hyperlink{event_handling_EVENT_SSL_ESTABLISHED}{E\+V\+E\+N\+T\+\_\+\+S\+S\+L\+\_\+\+E\+S\+T\+A\+B\+L\+I\+S\+H\+ED}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_SEND_MESSAGE}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+S\+E\+N\+D\+\_\+\+M\+E\+S\+S\+A\+GE}}, \mbox{\hyperlink{event_handling_EVENT_PACKET_SENT}{E\+V\+E\+N\+T\+\_\+\+P\+A\+C\+K\+E\+T\+\_\+\+S\+E\+NT}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_MESSAGE_RECEIVED}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+M\+E\+S\+S\+A\+G\+E\+\_\+\+R\+E\+C\+E\+I\+V\+ED}}, \mbox{\hyperlink{event_handling_EVENT_PACKET_READ}{E\+V\+E\+N\+T\+\_\+\+P\+A\+C\+K\+E\+T\+\_\+\+R\+E\+AD}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_REDIRECT}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+R\+E\+D\+I\+R\+E\+CT}}
\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+D\+I\+R\+E\+C\+T-\/\+E\+R\+R\+OR} & invalid redirect location given by remote \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+M\+A\+X\+I\+M\+U\+M-\/\+R\+E\+D\+I\+R\+E\+C\+T\+S-\/\+E\+X\+C\+E\+E\+D\+ED} & maximum redirect count exceeded \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+C\+E\+I\+V\+E-\/\+E\+R\+R\+OR} & unknown content encoding received or status error communicating with H\+T\+TP server (status code $<$ 100 or $>$ 299); in case of a status error the {\ttfamily \char`\"{}arg\char`\"{}} key of the exception hash will be set to a hash equal to the return value of the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{send()}} method including a {\ttfamily \char`\"{}status\+\_\+code\char`\"{}} key (giving the status code) and a {\ttfamily \char`\"{}body\char`\"{}} key (giving the message body returned by the server) \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+E\+N\+D-\/\+E\+R\+R\+OR} & There was an error sending the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+C\+L\+O\+S\+ED} & The remote end closed the connection \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+R\+E\+C\+V-\/\+E\+R\+R\+OR} & There was an error receiving the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+T\+I\+M\+E\+O\+UT} & Data transmission or reception for a single \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{send()}} or \mbox{\hyperlink{class_qore_1_1_socket_adba4badd712c161df1b2da87e528ecb8}{recv()}} action exceeded the timeout period \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+S\+L-\/\+E\+R\+R\+OR} & There was an S\+SL error while reading data from the socket \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+H\+T\+T\+P-\/\+E\+R\+R\+OR} & Invalid H\+T\+TP data was received\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
For possible exceptions when implicitly establishing a connection, see the \mbox{\hyperlink{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b}{Socket\+::connect()}} method (or \mbox{\hyperlink{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5}{Socket\+::connect\+S\+S\+L()}} for secure connections) 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_adbee3f312158d29d873527085eb48bea}\label{class_qore_1_1_h_t_t_p_client_adbee3f312158d29d873527085eb48bea}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!is\+Connected@{is\+Connected}}
\index{is\+Connected@{is\+Connected}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{is\+Connected()}{isConnected()}}
{\footnotesize\ttfamily bool Qore\+::\+H\+T\+T\+P\+Client\+::is\+Connected (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} or \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}} giving the current connection state. 

\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} or \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}} giving the current connection state
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
bool b = httpclient.isConnected();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a04c2df5e6fca680874e388a093fa136a}\label{class_qore_1_1_h_t_t_p_client_a04c2df5e6fca680874e388a093fa136a}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!is\+Proxy\+Secure@{is\+Proxy\+Secure}}
\index{is\+Proxy\+Secure@{is\+Proxy\+Secure}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{is\+Proxy\+Secure()}{isProxySecure()}}
{\footnotesize\ttfamily bool Qore\+::\+H\+T\+T\+P\+Client\+::is\+Proxy\+Secure (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the S\+S\+L/\+T\+LS flag for the next proxy connection. 

\begin{DoxyReturn}{Returns}
the S\+S\+L/\+T\+LS flag for the next proxy connection
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
bool b = httpclient.isProxySecure();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a5654958c7d5ca1106b092f85230a78f1}\label{class_qore_1_1_h_t_t_p_client_a5654958c7d5ca1106b092f85230a78f1}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!is\+Secure@{is\+Secure}}
\index{is\+Secure@{is\+Secure}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{is\+Secure()}{isSecure()}}
{\footnotesize\ttfamily bool Qore\+::\+H\+T\+T\+P\+Client\+::is\+Secure (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} if the current connection is encrypted, \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}} if not. 

\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} if the current connection is encrypted, \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}} if not
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\textcolor{keywordflow}{if} (httpclient.isSecure())
    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"secure connection: %s %s\(\backslash\)n"}, httpclient.getSSLCipherName(), 
      httpclient.getSSLCipherVersion());
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a228268e04d51d8e37d7c649349c9e0ff}\label{class_qore_1_1_h_t_t_p_client_a228268e04d51d8e37d7c649349c9e0ff}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!post@{post}}
\index{post@{post}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{post()}{post()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+H\+T\+T\+P\+Client\+::post (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{path,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{body,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}}}]{headers,  }\item[{\+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$}]{info }\end{DoxyParamCaption})}



Sends an H\+T\+TP {\ttfamily P\+O\+ST} request with a message body and returns the message body received as a string or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if no message body is received. 

In order to get the headers and the body in the response, use the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{H\+T\+T\+P\+Client\+::send()}} method instead.

If no connection is established, an internal call to \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a6df282a9db795b68ac5332f2429c4e8e}{H\+T\+T\+P\+Client\+::connect()}} will be made before sending the message.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.post(\textcolor{stringliteral}{"/path"}, body);
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em path} & the path for the message (i.\+e. {\ttfamily \char`\"{}/path/resource?method\&param=value\char`\"{}}) \\
\hline
{\em body} & the string to use as the message body \\
\hline
{\em headers} & An optional hash of headers to include in the message; values are converted to strings; a list is converted to a string of comma-\/separated values; headers that differ only in case will be overwritten by the last header in the hash with a matching name with a case-\/insensitive search \\
\hline
{\em info} & an optional reference to an lvalue that will be used as an output variable giving a hash of request headers and other information about the H\+T\+TP request; this hash contains the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily accept-\/charset}\+: this key will be set to an appropriate value from any {\ttfamily \char`\"{}\+Accept-\/\+Charset\char`\"{}} header; if any of {\ttfamily \char`\"{}$\ast$\char`\"{}}, {\ttfamily \char`\"{}utf8\char`\"{}}, or {\ttfamily \char`\"{}utf-\/8\char`\"{}} are present, then this will be set to {\ttfamily \char`\"{}utf8\char`\"{}}, otherwise it will be set to the first requested character encoding in the list
\item {\ttfamily charset\+:} if there is a {\ttfamily \char`\"{}charset\char`\"{}} declaration in the {\ttfamily \char`\"{}\+Content-\/\+Type\char`\"{}} header, the value is returned in this key
\item {\ttfamily body-\/content-\/type}\+: the outgoing message body M\+I\+ME {\ttfamily Content-\/\+Type} value
\item {\ttfamily headers\+:} a hash of outgoing H\+T\+TP request headers (returned as sent, without any case conversions)
\item {\ttfamily request-\/uri}\+: the request U\+RI string sent (ex\+: {\ttfamily \char`\"{}\+G\+E\+T /services/async/38.\+0/job H\+T\+T\+P/1.\+1\char`\"{}})
\item {\ttfamily request-\/body}\+: the raw message body in the request (before any content encoding)
\item {\ttfamily response-\/body}\+: the raw message body in the response (after any content decoding)
\item {\ttfamily response-\/headers}\+: a hash of incoming H\+T\+TP headers in the response with keys converted to all lower case for each header in the response message, plus the following Qore-\/provided keys\+:
\begin{DoxyItemize}
\item {\ttfamily http\+\_\+version\+:} the H\+T\+TP version in the response U\+RI
\item {\ttfamily status\+\_\+code\+:} the H\+T\+TP status code of the response
\item {\ttfamily status\+\_\+message\+:} the H\+T\+TP status message of the response
\end{DoxyItemize}
\item {\ttfamily response-\/uri}\+: the H\+T\+TP response U\+RI
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the message body in the reply to this message or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} in case no body was present in the response
\end{DoxyReturn}
\begin{DoxyParagraph}{Events\+:}
\mbox{\hyperlink{event_handling_EVENT_CONNECTING}{E\+V\+E\+N\+T\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+NG}}, \mbox{\hyperlink{event_handling_EVENT_CONNECTED}{E\+V\+E\+N\+T\+\_\+\+C\+O\+N\+N\+E\+C\+T\+ED}}, \mbox{\hyperlink{event_handling_EVENT_HOSTNAME_LOOKUP}{E\+V\+E\+N\+T\+\_\+\+H\+O\+S\+T\+N\+A\+M\+E\+\_\+\+L\+O\+O\+K\+UP}}, \mbox{\hyperlink{event_handling_EVENT_HOSTNAME_RESOLVED}{E\+V\+E\+N\+T\+\_\+\+H\+O\+S\+T\+N\+A\+M\+E\+\_\+\+R\+E\+S\+O\+L\+V\+ED}}, \mbox{\hyperlink{event_handling_EVENT_START_SSL}{E\+V\+E\+N\+T\+\_\+\+S\+T\+A\+R\+T\+\_\+\+S\+SL}}, \mbox{\hyperlink{event_handling_EVENT_SSL_ESTABLISHED}{E\+V\+E\+N\+T\+\_\+\+S\+S\+L\+\_\+\+E\+S\+T\+A\+B\+L\+I\+S\+H\+ED}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_SEND_MESSAGE}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+S\+E\+N\+D\+\_\+\+M\+E\+S\+S\+A\+GE}}, \mbox{\hyperlink{event_handling_EVENT_PACKET_SENT}{E\+V\+E\+N\+T\+\_\+\+P\+A\+C\+K\+E\+T\+\_\+\+S\+E\+NT}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_MESSAGE_RECEIVED}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+M\+E\+S\+S\+A\+G\+E\+\_\+\+R\+E\+C\+E\+I\+V\+ED}}, \mbox{\hyperlink{event_handling_EVENT_PACKET_READ}{E\+V\+E\+N\+T\+\_\+\+P\+A\+C\+K\+E\+T\+\_\+\+R\+E\+AD}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_CONTENT_LENGTH}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+C\+O\+N\+T\+E\+N\+T\+\_\+\+L\+E\+N\+G\+TH}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_CHUNKED_START}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+C\+H\+U\+N\+K\+E\+D\+\_\+\+S\+T\+A\+RT}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_CHUNKED_END}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+C\+H\+U\+N\+K\+E\+D\+\_\+\+E\+ND}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_CHUNKED_DATA_RECEIVED}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+C\+H\+U\+N\+K\+E\+D\+\_\+\+D\+A\+T\+A\+\_\+\+R\+E\+C\+E\+I\+V\+ED}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_CHUNK_SIZE}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+C\+H\+U\+N\+K\+\_\+\+S\+I\+ZE}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_FOOTERS_RECEIVED}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+F\+O\+O\+T\+E\+R\+S\+\_\+\+R\+E\+C\+E\+I\+V\+ED}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_REDIRECT}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+R\+E\+D\+I\+R\+E\+CT}}
\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+D\+I\+R\+E\+C\+T-\/\+E\+R\+R\+OR} & invalid redirect location given by remote \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+M\+A\+X\+I\+M\+U\+M-\/\+R\+E\+D\+I\+R\+E\+C\+T\+S-\/\+E\+X\+C\+E\+E\+D\+ED} & maximum redirect count exceeded \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+C\+E\+I\+V\+E-\/\+E\+R\+R\+OR} & unknown content encoding received or status error communicating with H\+T\+TP server (status code $<$ 100 or $>$ 299); in case of a status error the {\ttfamily \char`\"{}arg\char`\"{}} key of the exception hash will be set to a hash equal to the return value of the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{send()}} method including a {\ttfamily \char`\"{}status\+\_\+code\char`\"{}} key (giving the status code) and a {\ttfamily \char`\"{}body\char`\"{}} key (giving the message body returned by the server) \\
\hline
{\em E\+N\+C\+O\+D\+I\+N\+G-\/\+C\+O\+N\+V\+E\+R\+S\+I\+O\+N-\/\+E\+R\+R\+OR} & the given string could not be converted to the socket\textquotesingle{}s character encoding \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+E\+N\+D-\/\+E\+R\+R\+OR} & There was an error sending the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+C\+L\+O\+S\+ED} & The remote end closed the connection \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+R\+E\+C\+V-\/\+E\+R\+R\+OR} & There was an error receiving the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+T\+I\+M\+E\+O\+UT} & Data transmission or reception for a single \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{send()}} or \mbox{\hyperlink{class_qore_1_1_socket_adba4badd712c161df1b2da87e528ecb8}{recv()}} action exceeded the timeout period \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+S\+L-\/\+E\+R\+R\+OR} & There was an S\+SL error while reading data from the socket \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+H\+T\+T\+P-\/\+E\+R\+R\+OR} & Invalid H\+T\+TP data was received\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
For possible exceptions when implicitly establishing a connection, see the \mbox{\hyperlink{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b}{Socket\+::connect()}} method (or \mbox{\hyperlink{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5}{Socket\+::connect\+S\+S\+L()}} for secure connections) 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_ad924875b8a8f7e57c75a43c73bc1f883}\label{class_qore_1_1_h_t_t_p_client_ad924875b8a8f7e57c75a43c73bc1f883}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!post@{post}}
\index{post@{post}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{post()}{post()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+H\+T\+T\+P\+Client\+::post (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{path,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}}}]{body,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}}}]{headers,  }\item[{\+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$}]{info }\end{DoxyParamCaption})}



Sends an H\+T\+TP {\ttfamily P\+O\+ST} request with a message body and returns the message body received as a string or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if no message body is received. 

In order to get the headers and the body in the response, use the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{H\+T\+T\+P\+Client\+::send()}} method instead.

If no connection is established, an internal call to \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a6df282a9db795b68ac5332f2429c4e8e}{H\+T\+T\+P\+Client\+::connect()}} will be made before sending the message.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.post(\textcolor{stringliteral}{"/path"}, body);
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em path} & the path for the message (i.\+e. {\ttfamily \char`\"{}/path/resource?method\&param=value\char`\"{}}) \\
\hline
{\em body} & the optional data to use as the message body \\
\hline
{\em headers} & An optional hash of headers to include in the message; values are converted to strings; a list is converted to a string of comma-\/separated values; headers that differ only in case will be overwritten by the last header in the hash with a matching name with a case-\/insensitive search \\
\hline
{\em info} & an optional reference to an lvalue that will be used as an output variable giving a hash of request headers and other information about the H\+T\+TP request; this hash contains the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily accept-\/charset}\+: this key will be set to an appropriate value from any {\ttfamily \char`\"{}\+Accept-\/\+Charset\char`\"{}} header; if any of {\ttfamily \char`\"{}$\ast$\char`\"{}}, {\ttfamily \char`\"{}utf8\char`\"{}}, or {\ttfamily \char`\"{}utf-\/8\char`\"{}} are present, then this will be set to {\ttfamily \char`\"{}utf8\char`\"{}}, otherwise it will be set to the first requested character encoding in the list
\item {\ttfamily charset\+:} if there is a {\ttfamily \char`\"{}charset\char`\"{}} declaration in the {\ttfamily \char`\"{}\+Content-\/\+Type\char`\"{}} header, the value is returned in this key
\item {\ttfamily body-\/content-\/type}\+: the outgoing message body M\+I\+ME {\ttfamily Content-\/\+Type} value
\item {\ttfamily headers\+:} a hash of outgoing H\+T\+TP request headers (returned as sent, without any case conversions)
\item {\ttfamily request-\/uri}\+: the request U\+RI string sent (ex\+: {\ttfamily \char`\"{}\+G\+E\+T /services/async/38.\+0/job H\+T\+T\+P/1.\+1\char`\"{}})
\item {\ttfamily request-\/body}\+: the raw message body in the request (before any content encoding)
\item {\ttfamily response-\/body}\+: the raw message body in the response (after any content decoding)
\item {\ttfamily response-\/headers}\+: a hash of incoming H\+T\+TP headers in the response with keys converted to all lower case for each header in the response message, plus the following Qore-\/provided keys\+:
\begin{DoxyItemize}
\item {\ttfamily http\+\_\+version\+:} the H\+T\+TP version in the response U\+RI
\item {\ttfamily status\+\_\+code\+:} the H\+T\+TP status code of the response
\item {\ttfamily status\+\_\+message\+:} the H\+T\+TP status message of the response
\end{DoxyItemize}
\item {\ttfamily response-\/uri}\+: the H\+T\+TP response U\+RI
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the message body in the reply to this message or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} in case no body was present in the response
\end{DoxyReturn}
\begin{DoxyParagraph}{Events\+:}
\mbox{\hyperlink{event_handling_EVENT_CONNECTING}{E\+V\+E\+N\+T\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+NG}}, \mbox{\hyperlink{event_handling_EVENT_CONNECTED}{E\+V\+E\+N\+T\+\_\+\+C\+O\+N\+N\+E\+C\+T\+ED}}, \mbox{\hyperlink{event_handling_EVENT_HOSTNAME_LOOKUP}{E\+V\+E\+N\+T\+\_\+\+H\+O\+S\+T\+N\+A\+M\+E\+\_\+\+L\+O\+O\+K\+UP}}, \mbox{\hyperlink{event_handling_EVENT_HOSTNAME_RESOLVED}{E\+V\+E\+N\+T\+\_\+\+H\+O\+S\+T\+N\+A\+M\+E\+\_\+\+R\+E\+S\+O\+L\+V\+ED}}, \mbox{\hyperlink{event_handling_EVENT_START_SSL}{E\+V\+E\+N\+T\+\_\+\+S\+T\+A\+R\+T\+\_\+\+S\+SL}}, \mbox{\hyperlink{event_handling_EVENT_SSL_ESTABLISHED}{E\+V\+E\+N\+T\+\_\+\+S\+S\+L\+\_\+\+E\+S\+T\+A\+B\+L\+I\+S\+H\+ED}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_SEND_MESSAGE}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+S\+E\+N\+D\+\_\+\+M\+E\+S\+S\+A\+GE}}, \mbox{\hyperlink{event_handling_EVENT_PACKET_SENT}{E\+V\+E\+N\+T\+\_\+\+P\+A\+C\+K\+E\+T\+\_\+\+S\+E\+NT}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_MESSAGE_RECEIVED}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+M\+E\+S\+S\+A\+G\+E\+\_\+\+R\+E\+C\+E\+I\+V\+ED}}, \mbox{\hyperlink{event_handling_EVENT_PACKET_READ}{E\+V\+E\+N\+T\+\_\+\+P\+A\+C\+K\+E\+T\+\_\+\+R\+E\+AD}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_CONTENT_LENGTH}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+C\+O\+N\+T\+E\+N\+T\+\_\+\+L\+E\+N\+G\+TH}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_CHUNKED_START}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+C\+H\+U\+N\+K\+E\+D\+\_\+\+S\+T\+A\+RT}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_CHUNKED_END}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+C\+H\+U\+N\+K\+E\+D\+\_\+\+E\+ND}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_CHUNKED_DATA_RECEIVED}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+C\+H\+U\+N\+K\+E\+D\+\_\+\+D\+A\+T\+A\+\_\+\+R\+E\+C\+E\+I\+V\+ED}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_CHUNK_SIZE}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+C\+H\+U\+N\+K\+\_\+\+S\+I\+ZE}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_FOOTERS_RECEIVED}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+F\+O\+O\+T\+E\+R\+S\+\_\+\+R\+E\+C\+E\+I\+V\+ED}}, \mbox{\hyperlink{event_handling_EVENT_HTTP_REDIRECT}{E\+V\+E\+N\+T\+\_\+\+H\+T\+T\+P\+\_\+\+R\+E\+D\+I\+R\+E\+CT}}
\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+D\+I\+R\+E\+C\+T-\/\+E\+R\+R\+OR} & invalid redirect location given by remote \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+M\+A\+X\+I\+M\+U\+M-\/\+R\+E\+D\+I\+R\+E\+C\+T\+S-\/\+E\+X\+C\+E\+E\+D\+ED} & maximum redirect count exceeded \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+C\+E\+I\+V\+E-\/\+E\+R\+R\+OR} & unknown content encoding received or status error communicating with H\+T\+TP server (status code $<$ 100 or $>$ 299); in case of a status error the {\ttfamily \char`\"{}arg\char`\"{}} key of the exception hash will be set to a hash equal to the return value of the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{send()}} method including a {\ttfamily \char`\"{}status\+\_\+code\char`\"{}} key (giving the status code) and a {\ttfamily \char`\"{}body\char`\"{}} key (giving the message body returned by the server) \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+E\+N\+D-\/\+E\+R\+R\+OR} & There was an error sending the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+C\+L\+O\+S\+ED} & The remote end closed the connection \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+R\+E\+C\+V-\/\+E\+R\+R\+OR} & There was an error receiving the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+T\+I\+M\+E\+O\+UT} & Data transmission or reception for a single \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{send()}} or \mbox{\hyperlink{class_qore_1_1_socket_adba4badd712c161df1b2da87e528ecb8}{recv()}} action exceeded the timeout period \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+S\+L-\/\+E\+R\+R\+OR} & There was an S\+SL error while reading data from the socket \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+H\+T\+T\+P-\/\+E\+R\+R\+OR} & Invalid H\+T\+TP data was received\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
For possible exceptions when implicitly establishing a connection, see the \mbox{\hyperlink{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b}{Socket\+::connect()}} method (or \mbox{\hyperlink{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5}{Socket\+::connect\+S\+S\+L()}} for secure connections) 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}\label{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!send@{send}}
\index{send@{send}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{send()}{send()}\hspace{0.1cm}{\footnotesize\ttfamily [1/3]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} Qore\+::\+H\+T\+T\+P\+Client\+::send (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{body,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{method,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{path,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}}}]{headers,  }\item[{softbool}]{getbody = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}},  }\item[{\+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$}]{info }\end{DoxyParamCaption})}



Sends an H\+T\+TP request with the specified method and optional message body and returns headers and any body received as a response in a hash format. 

If a connection has not already been established, an internal call to \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a6df282a9db795b68ac5332f2429c4e8e}{H\+T\+T\+P\+Client\+::connect()}} will be made before sending the message

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
hash msg = httpclient.send(body, \textcolor{stringliteral}{"POST"}, \textcolor{stringliteral}{"/path"}, (\textcolor{stringliteral}{"Content-Type"}:\textcolor{stringliteral}{"application/x-yaml"}));
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em body} & The message body to send; note that sending an H\+T\+TP message bosdy with a {\ttfamily G\+ET} request is not standards compliant; see \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_httpclient_get_with_body}{H\+T\+TP G\+ET Requests With a Message Body}} for more information \\
\hline
{\em method} & The name of the H\+T\+TP method ({\ttfamily \char`\"{}\+G\+E\+T\char`\"{}}, {\ttfamily \char`\"{}\+P\+O\+S\+T\char`\"{}}, {\ttfamily \char`\"{}\+H\+E\+A\+D\char`\"{}}, {\ttfamily \char`\"{}\+O\+P\+T\+I\+O\+N\+S\char`\"{}}, {\ttfamily \char`\"{}\+P\+U\+T\char`\"{}}, {\ttfamily \char`\"{}\+D\+E\+L\+E\+T\+E\char`\"{}}, {\ttfamily \char`\"{}\+T\+R\+A\+C\+E\char`\"{}}, {\ttfamily \char`\"{}\+C\+O\+N\+N\+E\+C\+T\char`\"{}}, or {\ttfamily \char`\"{}\+P\+A\+T\+C\+H\char`\"{}}). Additional methods can be added in the constructor with the a {\ttfamily additional\+\_\+methods} option. \\
\hline
{\em path} & The path for the message (i.\+e. {\ttfamily \char`\"{}/path/resource?method\&param=value\char`\"{}}) \\
\hline
{\em headers} & An optional hash of headers to include in the message; values are converted to strings; a list is converted to a string of comma-\/separated values; headers that differ only in case will be overwritten by the last header in the hash with a matching name with a case-\/insensitive search \\
\hline
{\em getbody} & If this argument is \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}, then the object will try to receive a message body even if no {\ttfamily \char`\"{}\+Content-\/\+Length\char`\"{}} header is present in the response. Use this only with broken servers that send message bodies without a {\ttfamily \char`\"{}\+Content-\/\+Length\char`\"{}} header. \\
\hline
{\em info} & An optional reference to an lvalue that will be used as an output variable giving a hash of request headers and other information about the H\+T\+TP request; this hash contains the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily accept-\/charset}\+: this key will be set to an appropriate value from any {\ttfamily \char`\"{}\+Accept-\/\+Charset\char`\"{}} header; if any of {\ttfamily \char`\"{}$\ast$\char`\"{}}, {\ttfamily \char`\"{}utf8\char`\"{}}, or {\ttfamily \char`\"{}utf-\/8\char`\"{}} are present, then this will be set to {\ttfamily \char`\"{}utf8\char`\"{}}, otherwise it will be set to the first requested character encoding in the list
\item {\ttfamily charset\+:} if there is a {\ttfamily \char`\"{}charset\char`\"{}} declaration in the {\ttfamily \char`\"{}\+Content-\/\+Type\char`\"{}} header, the value is returned in this key
\item {\ttfamily body-\/content-\/type}\+: the outgoing message body M\+I\+ME {\ttfamily Content-\/\+Type} value
\item {\ttfamily headers\+:} a hash of outgoing H\+T\+TP request headers (returned as sent, without any case conversions)
\item {\ttfamily request-\/uri}\+: the request U\+RI string sent (ex\+: {\ttfamily \char`\"{}\+G\+E\+T /services/async/38.\+0/job H\+T\+T\+P/1.\+1\char`\"{}})
\item {\ttfamily request-\/body}\+: the raw message body in the request (before any content encoding)
\item {\ttfamily response-\/body}\+: the raw message body in the response (after any content decoding)
\item {\ttfamily response-\/headers}\+: a hash of incoming H\+T\+TP headers in the response with keys converted to all lower case for each header in the response message, plus the following Qore-\/provided keys\+:
\begin{DoxyItemize}
\item {\ttfamily http\+\_\+version\+:} the H\+T\+TP version in the response U\+RI
\item {\ttfamily status\+\_\+code\+:} the H\+T\+TP status code of the response
\item {\ttfamily status\+\_\+message\+:} the H\+T\+TP status message of the response
\end{DoxyItemize}
\item {\ttfamily response-\/uri}\+: the H\+T\+TP response U\+RI
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The headers received from the H\+T\+TP server with all key names converted to lower-\/case. The message body (if any) will be assigned to the value of the {\ttfamily \char`\"{}body\char`\"{}} key and the H\+T\+TP status will be assigned to the {\ttfamily \char`\"{}status\+\_\+code\char`\"{}} key.
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+M\+E\+T\+H\+O\+D-\/\+E\+R\+R\+OR} & invalid/unknown H\+T\+TP method passed \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+D\+I\+R\+E\+C\+T-\/\+E\+R\+R\+OR} & invalid redirect location given by remote \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+M\+A\+X\+I\+M\+U\+M-\/\+R\+E\+D\+I\+R\+E\+C\+T\+S-\/\+E\+X\+C\+E\+E\+D\+ED} & maximum redirect count exceeded \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+C\+E\+I\+V\+E-\/\+E\+R\+R\+OR} & unknown content encoding received or status error communicating with H\+T\+TP server (status code $<$ 100 or $>$ 299); in case of a status error the {\ttfamily \char`\"{}arg\char`\"{}} key of the exception hash will be set to a hash equal to the normal return value of this method including a {\ttfamily \char`\"{}status\+\_\+code\char`\"{}} key (giving the status code) and a {\ttfamily \char`\"{}body\char`\"{}} key (giving the message body returned by the server) \\
\hline
{\em E\+N\+C\+O\+D\+I\+N\+G-\/\+C\+O\+N\+V\+E\+R\+S\+I\+O\+N-\/\+E\+R\+R\+OR} & the given string could not be converted to the socket\textquotesingle{}s character encoding \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+E\+N\+D-\/\+E\+R\+R\+OR} & There was an error sending the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+C\+L\+O\+S\+ED} & The remote end closed the connection \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+R\+E\+C\+V-\/\+E\+R\+R\+OR} & There was an error receiving the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+T\+I\+M\+E\+O\+UT} & Data transmission or reception for a single \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{send()}} or \mbox{\hyperlink{class_qore_1_1_socket_adba4badd712c161df1b2da87e528ecb8}{recv()}} action exceeded the timeout period \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+S\+L-\/\+E\+R\+R\+OR} & There was an S\+SL error while reading data from the socket \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+H\+T\+T\+P-\/\+E\+R\+R\+OR} & Invalid H\+T\+TP data was received\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
For possible exceptions when implicitly establishing a connection, see the \mbox{\hyperlink{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b}{Socket\+::connect()}} method (or \mbox{\hyperlink{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5}{Socket\+::connect\+S\+S\+L()}} for secure connections)
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_httpclient_get_with_body}{H\+T\+TP G\+ET Requests With a Message Body}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a70e6c929d24b711362fc17817507e82c}\label{class_qore_1_1_h_t_t_p_client_a70e6c929d24b711362fc17817507e82c}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!send@{send}}
\index{send@{send}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{send()}{send()}\hspace{0.1cm}{\footnotesize\ttfamily [2/3]}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} Qore\+::\+H\+T\+T\+P\+Client\+::send (\begin{DoxyParamCaption}\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}}}]{body,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{method,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{path,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}}}]{headers,  }\item[{softbool}]{getbody = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}},  }\item[{\+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$}]{info }\end{DoxyParamCaption})}



Sends an H\+T\+TP request with the specified method and optional message body and returns headers and any body received as a response in a hash format. 

If a connection has not already been established, an internal call to \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a6df282a9db795b68ac5332f2429c4e8e}{H\+T\+T\+P\+Client\+::connect()}} will be made before sending the message

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
hash msg = httpclient.send(body, \textcolor{stringliteral}{"POST"}, \textcolor{stringliteral}{"/path"}, (\textcolor{stringliteral}{"Content-Type"}:\textcolor{stringliteral}{"application/x-yaml"}));
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em body} & The message body to send; pass \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} (no value) to send no body \\
\hline
{\em method} & The name of the H\+T\+TP method ({\ttfamily \char`\"{}\+G\+E\+T\char`\"{}}, {\ttfamily \char`\"{}\+P\+O\+S\+T\char`\"{}}, {\ttfamily \char`\"{}\+H\+E\+A\+D\char`\"{}}, {\ttfamily \char`\"{}\+O\+P\+T\+I\+O\+N\+S\char`\"{}}, {\ttfamily \char`\"{}\+P\+U\+T\char`\"{}}, {\ttfamily \char`\"{}\+D\+E\+L\+E\+T\+E\char`\"{}}, {\ttfamily \char`\"{}\+T\+R\+A\+C\+E\char`\"{}}, {\ttfamily \char`\"{}\+C\+O\+N\+N\+E\+C\+T\char`\"{}}, or {\ttfamily \char`\"{}\+P\+A\+T\+C\+H\char`\"{}}). Additional methods can be added in the constructor with the a {\ttfamily additional\+\_\+methods} option. \\
\hline
{\em path} & The path for the message (i.\+e. {\ttfamily \char`\"{}/path/resource?method\&param=value\char`\"{}}) \\
\hline
{\em headers} & An optional hash of headers to include in the message; values are converted to strings; a list is converted to a string of comma-\/separated values; headers that differ only in case will be overwritten by the last header in the hash with a matching name with a case-\/insensitive search \\
\hline
{\em getbody} & If this argument is \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}, then the object will try to receive a message body even if no {\ttfamily \char`\"{}\+Content-\/\+Length\char`\"{}} header is present in the response. Use this only with broken servers that send message bodies without a {\ttfamily \char`\"{}\+Content-\/\+Length\char`\"{}} header. \\
\hline
{\em info} & An optional reference to an lvalue that will be used as an output variable giving a hash of request headers and other information about the H\+T\+TP request; this hash contains the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily accept-\/charset}\+: this key will be set to an appropriate value from any {\ttfamily \char`\"{}\+Accept-\/\+Charset\char`\"{}} header; if any of {\ttfamily \char`\"{}$\ast$\char`\"{}}, {\ttfamily \char`\"{}utf8\char`\"{}}, or {\ttfamily \char`\"{}utf-\/8\char`\"{}} are present, then this will be set to {\ttfamily \char`\"{}utf8\char`\"{}}, otherwise it will be set to the first requested character encoding in the list
\item {\ttfamily charset\+:} if there is a {\ttfamily \char`\"{}charset\char`\"{}} declaration in the {\ttfamily \char`\"{}\+Content-\/\+Type\char`\"{}} header, the value is returned in this key
\item {\ttfamily body-\/content-\/type}\+: the outgoing message body M\+I\+ME {\ttfamily Content-\/\+Type} value
\item {\ttfamily headers\+:} a hash of outgoing H\+T\+TP request headers (returned as sent, without any case conversions)
\item {\ttfamily request-\/uri}\+: the request U\+RI string sent (ex\+: {\ttfamily \char`\"{}\+G\+E\+T /services/async/38.\+0/job H\+T\+T\+P/1.\+1\char`\"{}})
\item {\ttfamily request-\/body}\+: the raw message body in the request (before any content encoding)
\item {\ttfamily response-\/body}\+: the raw message body in the response (after any content decoding)
\item {\ttfamily response-\/headers}\+: a hash of incoming H\+T\+TP headers in the response with keys converted to all lower case for each header in the response message, plus the following Qore-\/provided keys\+:
\begin{DoxyItemize}
\item {\ttfamily http\+\_\+version\+:} the H\+T\+TP version in the response U\+RI
\item {\ttfamily status\+\_\+code\+:} the H\+T\+TP status code of the response
\item {\ttfamily status\+\_\+message\+:} the H\+T\+TP status message of the response
\end{DoxyItemize}
\item {\ttfamily response-\/uri}\+: the H\+T\+TP response U\+RI
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The headers received from the H\+T\+TP server with all key names converted to lower-\/case. The message body (if any) will be assigned to the value of the {\ttfamily \char`\"{}body\char`\"{}} key and the H\+T\+TP status will be assigned to the {\ttfamily \char`\"{}status\+\_\+code\char`\"{}} key.
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+M\+E\+T\+H\+O\+D-\/\+E\+R\+R\+OR} & invalid/unknown H\+T\+TP method passed \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+D\+I\+R\+E\+C\+T-\/\+E\+R\+R\+OR} & invalid redirect location given by remote \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+M\+A\+X\+I\+M\+U\+M-\/\+R\+E\+D\+I\+R\+E\+C\+T\+S-\/\+E\+X\+C\+E\+E\+D\+ED} & maximum redirect count exceeded \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+C\+E\+I\+V\+E-\/\+E\+R\+R\+OR} & unknown content encoding received or status error communicating with H\+T\+TP server (status code $<$ 100 or $>$ 299); in case of a status error the {\ttfamily \char`\"{}arg\char`\"{}} key of the exception hash will be set to a hash equal to the normal return value of this method including a {\ttfamily \char`\"{}status\+\_\+code\char`\"{}} key (giving the status code) and a {\ttfamily \char`\"{}body\char`\"{}} key (giving the message body returned by the server) \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+E\+N\+D-\/\+E\+R\+R\+OR} & There was an error sending the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+C\+L\+O\+S\+ED} & The remote end closed the connection \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+R\+E\+C\+V-\/\+E\+R\+R\+OR} & There was an error receiving the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+T\+I\+M\+E\+O\+UT} & Data transmission or reception for a single \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{send()}} or \mbox{\hyperlink{class_qore_1_1_socket_adba4badd712c161df1b2da87e528ecb8}{recv()}} action exceeded the timeout period \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+S\+L-\/\+E\+R\+R\+OR} & There was an S\+SL error while reading data from the socket \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+H\+T\+T\+P-\/\+E\+R\+R\+OR} & Invalid H\+T\+TP data was received\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
For possible exceptions when implicitly establishing a connection, see the \mbox{\hyperlink{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b}{Socket\+::connect()}} method (or \mbox{\hyperlink{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5}{Socket\+::connect\+S\+S\+L()}} for secure connections)
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_httpclient_get_with_body}{H\+T\+TP G\+ET Requests With a Message Body}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_aaaacf1fe10f2affb6343600e123bd0bd}\label{class_qore_1_1_h_t_t_p_client_aaaacf1fe10f2affb6343600e123bd0bd}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!send@{send}}
\index{send@{send}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{send()}{send()}\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::send (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_qore_1_1_output_stream}{Qore\+::\+Output\+Stream}}}]{os,  }\item[{\+\_\+\+\_\+7\+\_\+ data}]{body,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{method,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{path,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}}}]{headers,  }\item[{timeout}]{timeout\+\_\+ms = {\ttfamily 0},  }\item[{softbool}]{getbody = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}},  }\item[{\+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$}]{info,  }\item[{\+\_\+\+\_\+7\+\_\+ code}]{rcb }\end{DoxyParamCaption})}



Sends an H\+T\+TP request with the specified method and optional message body; headers are returned through an optional receive callback and any body received is written to the \mbox{\hyperlink{class_qore_1_1_output_stream}{Output\+Stream}}. 

This method is useful for receiving data in real time; data are sent to the output stream as soon as they are received. If a connection has not already been established, an internal call to \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a6df282a9db795b68ac5332f2429c4e8e}{H\+T\+T\+P\+Client\+::connect()}} will be made before sending the message

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\textcolor{comment}{# save the HTTP response body directly to a file with a random file name}
string fn = tmp\_location() + DirSep + get\_random\_string() + \textcolor{stringliteral}{".tmp"}
FileOutputString output\_stream(fn);
\textcolor{comment}{# log the "X-Logme" header}
code rcb = sub (hash h) \{
    \textcolor{keywordflow}{if} (h.hdr.\textcolor{stringliteral}{"x-logme"})
        log(\textcolor{stringliteral}{"X-Logme: %y"}, h.hdr.\textcolor{stringliteral}{"x-logme"});
\};
httpclient.send(output\_stream, data, \textcolor{stringliteral}{"POST"}, \textcolor{stringliteral}{"/path"}, (\textcolor{stringliteral}{"Content-Type"}:\textcolor{stringliteral}{"application/x-yaml"}), NOTHING, 
      NOTHING, NOTHING, rcb);
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em os} & The \mbox{\hyperlink{class_qore_1_1_output_stream}{Output\+Stream}} to write the response body to \\
\hline
{\em body} & The message body to send; pass \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} (no value) to send no body \\
\hline
{\em method} & The name of the H\+T\+TP method ({\ttfamily \char`\"{}\+G\+E\+T\char`\"{}}, {\ttfamily \char`\"{}\+P\+O\+S\+T\char`\"{}}, {\ttfamily \char`\"{}\+H\+E\+A\+D\char`\"{}}, {\ttfamily \char`\"{}\+O\+P\+T\+I\+O\+N\+S\char`\"{}}, {\ttfamily \char`\"{}\+P\+U\+T\char`\"{}}, {\ttfamily \char`\"{}\+D\+E\+L\+E\+T\+E\char`\"{}}, {\ttfamily \char`\"{}\+T\+R\+A\+C\+E\char`\"{}}, {\ttfamily \char`\"{}\+C\+O\+N\+N\+E\+C\+T\char`\"{}}, or {\ttfamily \char`\"{}\+P\+A\+T\+C\+H\char`\"{}}). Additional methods can be added in the constructor with the a {\ttfamily additional\+\_\+methods} option. \\
\hline
{\em path} & The path for the message (i.\+e. {\ttfamily \char`\"{}/path/resource?method\&param=value\char`\"{}}) \\
\hline
{\em headers} & An optional hash of headers to include in the message; values are converted to strings; a list is converted to a string of comma-\/separated values; headers that differ only in case will be overwritten by the last header in the hash with a matching name with a case-\/insensitive search \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds for the socket I/O operations; 0 means use the default timeout value \\
\hline
{\em getbody} & If this argument is \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}, then the object will try to receive a message body even if no {\ttfamily \char`\"{}\+Content-\/\+Length\char`\"{}} header is present in the response. Use this only with broken servers that send message bodies without a {\ttfamily \char`\"{}\+Content-\/\+Length\char`\"{}} header. \\
\hline
{\em info} & An optional reference to an lvalue that will be used as an output variable giving a hash of request headers and other information about the H\+T\+TP request. \\
\hline
{\em rcb} & An optional receive callback for message headers received only; header or trailer data is placed in a hash with the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily \char`\"{}hdr\char`\"{}}\+: this can be assigned to \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} for the trailer hash if the data was not sent chunked or no trailers were included in a chunked message
\item {\ttfamily \char`\"{}obj\char`\"{}}\+: this is the owning object (so socket parameters can be changed based on headers received, such as, for example, socket character encoding)
\end{DoxyItemize}\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+M\+E\+T\+H\+O\+D-\/\+E\+R\+R\+OR} & invalid/unknown H\+T\+TP method passed \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+D\+I\+R\+E\+C\+T-\/\+E\+R\+R\+OR} & invalid redirect location given by remote \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+M\+A\+X\+I\+M\+U\+M-\/\+R\+E\+D\+I\+R\+E\+C\+T\+S-\/\+E\+X\+C\+E\+E\+D\+ED} & maximum redirect count exceeded \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+C\+E\+I\+V\+E-\/\+E\+R\+R\+OR} & unknown content encoding received or status error communicating with H\+T\+TP server (status code $<$ 100 or $>$ 299); in case of a status error the {\ttfamily \char`\"{}arg\char`\"{}} key of the exception hash will be set to a hash equal to the normal return value of this method including a {\ttfamily \char`\"{}status\+\_\+code\char`\"{}} key (giving the status code) and a {\ttfamily \char`\"{}body\char`\"{}} key (giving the message body returned by the server); status errors are not thrown in case a receive callback is used \\
\hline
{\em E\+N\+C\+O\+D\+I\+N\+G-\/\+C\+O\+N\+V\+E\+R\+S\+I\+O\+N-\/\+E\+R\+R\+OR} & the given string could not be converted to the socket\textquotesingle{}s character encoding \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+E\+N\+D-\/\+E\+R\+R\+OR} & There was an error sending the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+C\+L\+O\+S\+ED} & The remote end closed the connection \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+R\+E\+C\+V-\/\+E\+R\+R\+OR} & There was an error receiving the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+T\+I\+M\+E\+O\+UT} & Data transmission or reception for a single \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{send()}} or \mbox{\hyperlink{class_qore_1_1_socket_adba4badd712c161df1b2da87e528ecb8}{recv()}} action exceeded the timeout period \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+S\+L-\/\+E\+R\+R\+OR} & There was an S\+SL error while reading data from the socket \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+H\+T\+T\+P-\/\+E\+R\+R\+OR} & Invalid H\+T\+TP data was received\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
For possible exceptions when implicitly establishing a connection, see the \mbox{\hyperlink{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b}{Socket\+::connect()}} method (or \mbox{\hyperlink{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5}{Socket\+::connect\+S\+S\+L()}} for secure connections)
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_aa0b8e59ebd5518bfb4ec8a7d3e3f1e14}\label{class_qore_1_1_h_t_t_p_client_aa0b8e59ebd5518bfb4ec8a7d3e3f1e14}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!send\+Chunked@{send\+Chunked}}
\index{send\+Chunked@{send\+Chunked}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{send\+Chunked()}{sendChunked()}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::send\+Chunked (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_qore_1_1_output_stream}{Qore\+::\+Output\+Stream}}}]{os,  }\item[{\mbox{\hyperlink{class_qore_1_1_input_stream}{Qore\+::\+Input\+Stream}}}]{is,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{method,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{max\+\_\+chunk\+\_\+size = {\ttfamily 4096},  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{path,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}}}]{headers,  }\item[{timeout}]{timeout\+\_\+ms = {\ttfamily 0},  }\item[{softbool}]{getbody = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}},  }\item[{\+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$}]{info,  }\item[{\+\_\+\+\_\+7\+\_\+ code}]{rcb,  }\item[{\+\_\+\+\_\+7\+\_\+ code}]{tcb }\end{DoxyParamCaption})}



Sends a chunked H\+T\+TP request with the specified method and message body; headers are returned through an optional receive callback and any body received is written to the \mbox{\hyperlink{class_qore_1_1_output_stream}{Output\+Stream}}. 

This method is useful for receiving data in real time; data are sent to the output stream as soon as they are received. If a connection has not already been established, an internal call to \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a6df282a9db795b68ac5332f2429c4e8e}{H\+T\+T\+P\+Client\+::connect()}} will be made before sending the message

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\textcolor{comment}{# save the HTTP response body directly to a file with a random file name}
string fn = tmp\_location() + DirSep + get\_random\_string() + \textcolor{stringliteral}{".tmp"}
FileOutputString output\_stream(fn);
\textcolor{comment}{# log the "X-Logme" header}
code rcb = sub (hash h) \{
    \textcolor{keywordflow}{if} (h.hdr.\textcolor{stringliteral}{"x-logme"})
        log(\textcolor{stringliteral}{"X-Logme: %y"}, h.hdr.\textcolor{stringliteral}{"x-logme"});
\};
\textcolor{comment}{# write the "X-Content-Done" header when done}
code tcb = *hash sub () \{
    \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"X-Content-Done"}: \textcolor{stringliteral}{"true"});
\};
httpclient.sendChunked(output\_stream, input\_stream, \textcolor{stringliteral}{"POST"}, \textcolor{stringliteral}{"/path"}, (\textcolor{stringliteral}{"Content-Type"}:\textcolor{stringliteral}{"application/x-yaml"}),
       NOTHING, NOTHING, NOTHING, rcb, tcb);
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em os} & The \mbox{\hyperlink{class_qore_1_1_output_stream}{Output\+Stream}} to write the response body to \\
\hline
{\em is} & The \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} to read the request body from; each read will be sent as a separate chunk \\
\hline
{\em method} & The name of the H\+T\+TP method ({\ttfamily \char`\"{}\+G\+E\+T\char`\"{}}, {\ttfamily \char`\"{}\+P\+O\+S\+T\char`\"{}}, {\ttfamily \char`\"{}\+H\+E\+A\+D\char`\"{}}, {\ttfamily \char`\"{}\+O\+P\+T\+I\+O\+N\+S\char`\"{}}, {\ttfamily \char`\"{}\+P\+U\+T\char`\"{}}, {\ttfamily \char`\"{}\+D\+E\+L\+E\+T\+E\char`\"{}}, {\ttfamily \char`\"{}\+T\+R\+A\+C\+E\char`\"{}}, {\ttfamily \char`\"{}\+C\+O\+N\+N\+E\+C\+T\char`\"{}}, or {\ttfamily \char`\"{}\+P\+A\+T\+C\+H\char`\"{}}). Additional methods can be added in the constructor with the a {\ttfamily additional\+\_\+methods} option. \\
\hline
{\em max\+\_\+chunk\+\_\+size} & the maximum chunk size as the read block size for the \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} read block size; the actual size of the data read will determine the size of each H\+T\+TP chunk \\
\hline
{\em path} & The path for the message (i.\+e. {\ttfamily \char`\"{}/path/resource?method\&param=value\char`\"{}}) \\
\hline
{\em headers} & An optional hash of headers to include in the message; values are converted to strings; a list is converted to a string of comma-\/separated values; headers that differ only in case will be overwritten by the last header in the hash with a matching name with a case-\/insensitive search \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds for the socket I/O operations; 0 means use the default timeout value \\
\hline
{\em getbody} & If this argument is \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}, then the object will try to receive a message body even if no {\ttfamily \char`\"{}\+Content-\/\+Length\char`\"{}} header is present in the response. Use this only with broken servers that send message bodies without a {\ttfamily \char`\"{}\+Content-\/\+Length\char`\"{}} header. \\
\hline
{\em info} & An optional reference to an lvalue that will be used as an output variable giving a hash of request headers and other information about the H\+T\+TP request. \\
\hline
{\em rcb} & An optional receive callback for message headers received only; header or trailer data is placed in a hash with the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily \char`\"{}hdr\char`\"{}}\+: this can be assigned to \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} for the trailer hash if the data was not sent chunked or no trailers were included in a chunked message
\item {\ttfamily \char`\"{}obj\char`\"{}}\+: this is the owning object (so socket parameters can be changed based on headers received, such as, for example, socket character encoding) 
\end{DoxyItemize}\\
\hline
{\em tcb} & An optional trailer callback for message trailers to write in the outgoing chunked message; the callback takes no arguments and must return either \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} or \mbox{\hyperlink{data_type_declarations_hash_type}{hash}} giving a hash of trailers for the final chunk\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+M\+E\+T\+H\+O\+D-\/\+E\+R\+R\+OR} & invalid/unknown H\+T\+TP method passed \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+D\+I\+R\+E\+C\+T-\/\+E\+R\+R\+OR} & invalid redirect location given by remote \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+M\+A\+X\+I\+M\+U\+M-\/\+R\+E\+D\+I\+R\+E\+C\+T\+S-\/\+E\+X\+C\+E\+E\+D\+ED} & maximum redirect count exceeded \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+C\+E\+I\+V\+E-\/\+E\+R\+R\+OR} & unknown content encoding received or status error communicating with H\+T\+TP server (status code $<$ 100 or $>$ 299); in case of a status error the {\ttfamily \char`\"{}arg\char`\"{}} key of the exception hash will be set to a hash equal to the normal return value of this method including a {\ttfamily \char`\"{}status\+\_\+code\char`\"{}} key (giving the status code) and a {\ttfamily \char`\"{}body\char`\"{}} key (giving the message body returned by the server); status errors are not thrown in case a receive callback is used \\
\hline
{\em H\+T\+T\+P-\/\+C\+H\+U\+N\+K-\/\+E\+R\+R\+OR} & the chunk size given is not greater than 0 \\
\hline
{\em H\+T\+T\+P-\/\+T\+R\+A\+I\+L\+E\+R-\/\+E\+R\+R\+OR} & the trailer callback must return either \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} or \mbox{\hyperlink{data_type_declarations_hash_type}{hash}}; this exception is thrown is another type is returned \\
\hline
{\em E\+N\+C\+O\+D\+I\+N\+G-\/\+C\+O\+N\+V\+E\+R\+S\+I\+O\+N-\/\+E\+R\+R\+OR} & the given string could not be converted to the socket\textquotesingle{}s character encoding \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+E\+N\+D-\/\+E\+R\+R\+OR} & There was an error sending the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+C\+L\+O\+S\+ED} & The remote end closed the connection \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+R\+E\+C\+V-\/\+E\+R\+R\+OR} & There was an error receiving the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+T\+I\+M\+E\+O\+UT} & Data transmission or reception for a single \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{send()}} or \mbox{\hyperlink{class_qore_1_1_socket_adba4badd712c161df1b2da87e528ecb8}{recv()}} action exceeded the timeout period \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+S\+L-\/\+E\+R\+R\+OR} & There was an S\+SL error while reading data from the socket \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+H\+T\+T\+P-\/\+E\+R\+R\+OR} & Invalid H\+T\+TP data was received\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
For possible exceptions when implicitly establishing a connection, see the \mbox{\hyperlink{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b}{Socket\+::connect()}} method (or \mbox{\hyperlink{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5}{Socket\+::connect\+S\+S\+L()}} for secure connections)
\end{DoxyNote}
\begin{DoxySince}{Since}
Qore 0.\+8.\+13 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_ad28aeda6922927ee534ddc2b5a9d7528}\label{class_qore_1_1_h_t_t_p_client_ad28aeda6922927ee534ddc2b5a9d7528}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!send\+With\+Callbacks@{send\+With\+Callbacks}}
\index{send\+With\+Callbacks@{send\+With\+Callbacks}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{send\+With\+Callbacks()}{sendWithCallbacks()}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::send\+With\+Callbacks (\begin{DoxyParamCaption}\item[{code}]{scb,  }\item[{code}]{rcb,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{method,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{path,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}}}]{headers,  }\item[{timeout}]{timeout\+\_\+ms = {\ttfamily 0},  }\item[{softbool}]{getbody = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}},  }\item[{\+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$}]{info }\end{DoxyParamCaption})}



Sends an H\+T\+TP request with the specified method and chunked message body as given by a send callback; headers and any body received are returned through a receive callback. 

This method is useful for sending chunked message data where the response is also a sent with chunked transfer encoding; chunks are sent to the receive callback as soon as they are received. If a connection has not already been established, an internal call to \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a6df282a9db795b68ac5332f2429c4e8e}{H\+T\+T\+P\+Client\+::connect()}} will be made before sending the message

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.sendWithCallbacks(send\_callback, rcv\_callback, \textcolor{stringliteral}{"POST"}, \textcolor{stringliteral}{"/path"}, (\textcolor{stringliteral}{"Content-Type"}:\textcolor{stringliteral}{"
      application/x-yaml"}));
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em scb} & The callback giving the chunked H\+T\+TP data to send; this callback must return either a string or a binary value each time it is called to give the chunked data to send; when all data has been sent, then a hash of message trailers can be sent or simply \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} which will close the chunked message \\
\hline
{\em rcb} & The receive callback for the data received; first this method is called with a hash of the message headers, and then with any message body; if a chunked H\+T\+TP message is received, then the callback is called once for each chunk; when the message has been received, then the receive callback is called with a hash representing any trailer data received in a chunked transfer or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if the data was received in a normal message body or if there was no trailer data in a chunked transfer. The argument to this callback is always a hash; data calls have the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily \char`\"{}data\char`\"{}}\+: the string or binary data
\item {\ttfamily \char`\"{}chunked\char`\"{}}\+: True if the data was received with chunked transfer encoding, False if not
\end{DoxyItemize}Header or trailer data is placed in a hash with the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily \char`\"{}hdr\char`\"{}}\+: this can be assigned to \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} for the trailer hash if the data was not sent chunked or no trailers were included in a chunked message
\item {\ttfamily \char`\"{}obj\char`\"{}}\+: this is the owning object (so socket parameters can be changed based on headers received, such as, for example, socket character encoding)
\item {\ttfamily \char`\"{}send\+\_\+aborted\char`\"{}}\+: this is set to \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}} if a response header was set while sending an outgoing chunked message 
\end{DoxyItemize}\\
\hline
{\em method} & The name of the H\+T\+TP method ({\ttfamily \char`\"{}\+G\+E\+T\char`\"{}}, {\ttfamily \char`\"{}\+P\+O\+S\+T\char`\"{}}, {\ttfamily \char`\"{}\+H\+E\+A\+D\char`\"{}}, {\ttfamily \char`\"{}\+O\+P\+T\+I\+O\+N\+S\char`\"{}}, {\ttfamily \char`\"{}\+P\+U\+T\char`\"{}}, {\ttfamily \char`\"{}\+D\+E\+L\+E\+T\+E\char`\"{}}, {\ttfamily \char`\"{}\+T\+R\+A\+C\+E\char`\"{}}, {\ttfamily \char`\"{}\+C\+O\+N\+N\+E\+C\+T\char`\"{}}, or {\ttfamily \char`\"{}\+P\+A\+T\+C\+H\char`\"{}}). Additional methods can be added in the constructor with the a {\ttfamily additional\+\_\+methods} option. \\
\hline
{\em path} & The path for the message (i.\+e. {\ttfamily \char`\"{}/path/resource?method\&param=value\char`\"{}}) \\
\hline
{\em headers} & An optional hash of headers to include in the message; values are converted to strings; a list is converted to a string of comma-\/separated values; headers that differ only in case will be overwritten by the last header in the hash with a matching name with a case-\/insensitive search \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds for the socket I/O operations; 0 means use the default timeout value \\
\hline
{\em getbody} & If this argument is \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}, then the object will try to receive a message body even if no {\ttfamily \char`\"{}\+Content-\/\+Length\char`\"{}} header is present in the response. Use this only with broken servers that send message bodies without a {\ttfamily \char`\"{}\+Content-\/\+Length\char`\"{}} header. \\
\hline
{\em info} & An optional reference to an lvalue that will be used as an output variable giving a hash of request headers and other information about the H\+T\+TP request; this hash contains the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily accept-\/charset}\+: this key will be set to an appropriate value from any {\ttfamily \char`\"{}\+Accept-\/\+Charset\char`\"{}} header; if any of {\ttfamily \char`\"{}$\ast$\char`\"{}}, {\ttfamily \char`\"{}utf8\char`\"{}}, or {\ttfamily \char`\"{}utf-\/8\char`\"{}} are present, then this will be set to {\ttfamily \char`\"{}utf8\char`\"{}}, otherwise it will be set to the first requested character encoding in the list
\item {\ttfamily charset\+:} if there is a {\ttfamily \char`\"{}charset\char`\"{}} declaration in the {\ttfamily \char`\"{}\+Content-\/\+Type\char`\"{}} header, the value is returned in this key
\item {\ttfamily body-\/content-\/type}\+: the outgoing message body M\+I\+ME {\ttfamily Content-\/\+Type} value
\item {\ttfamily headers\+:} a hash of outgoing H\+T\+TP request headers (returned as sent, without any case conversions)
\item {\ttfamily request-\/uri}\+: the request U\+RI string sent (ex\+: {\ttfamily \char`\"{}\+G\+E\+T /services/async/38.\+0/job H\+T\+T\+P/1.\+1\char`\"{}})
\item {\ttfamily request-\/body}\+: the raw message body in the request (before any content encoding)
\item {\ttfamily response-\/body}\+: the raw message body in the response (after any content decoding)
\item {\ttfamily response-\/headers}\+: a hash of incoming H\+T\+TP headers in the response with keys converted to all lower case for each header in the response message, plus the following Qore-\/provided keys\+:
\begin{DoxyItemize}
\item {\ttfamily http\+\_\+version\+:} the H\+T\+TP version in the response U\+RI
\item {\ttfamily status\+\_\+code\+:} the H\+T\+TP status code of the response
\item {\ttfamily status\+\_\+message\+:} the H\+T\+TP status message of the response
\end{DoxyItemize}
\item {\ttfamily response-\/uri}\+: the H\+T\+TP response U\+RI
\end{DoxyItemize}\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+M\+E\+T\+H\+O\+D-\/\+E\+R\+R\+OR} & invalid/unknown H\+T\+TP method passed \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+D\+I\+R\+E\+C\+T-\/\+E\+R\+R\+OR} & invalid redirect location given by remote \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+M\+A\+X\+I\+M\+U\+M-\/\+R\+E\+D\+I\+R\+E\+C\+T\+S-\/\+E\+X\+C\+E\+E\+D\+ED} & maximum redirect count exceeded \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+C\+E\+I\+V\+E-\/\+E\+R\+R\+OR} & unknown content encoding received or status error communicating with H\+T\+TP server (status code $<$ 100 or $>$ 299); in case of a status error the {\ttfamily \char`\"{}arg\char`\"{}} key of the exception hash will be set to a hash equal to the normal return value of this method including a {\ttfamily \char`\"{}status\+\_\+code\char`\"{}} key (giving the status code) and a {\ttfamily \char`\"{}body\char`\"{}} key (giving the message body returned by the server) \\
\hline
{\em E\+N\+C\+O\+D\+I\+N\+G-\/\+C\+O\+N\+V\+E\+R\+S\+I\+O\+N-\/\+E\+R\+R\+OR} & the given string could not be converted to the socket\textquotesingle{}s character encoding \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+E\+N\+D-\/\+E\+R\+R\+OR} & There was an error sending the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+C\+L\+O\+S\+ED} & The remote end closed the connection \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+R\+E\+C\+V-\/\+E\+R\+R\+OR} & There was an error receiving the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+T\+I\+M\+E\+O\+UT} & Data transmission or reception for a single \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{send()}} or \mbox{\hyperlink{class_qore_1_1_socket_adba4badd712c161df1b2da87e528ecb8}{recv()}} action exceeded the timeout period \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+S\+L-\/\+E\+R\+R\+OR} & There was an S\+SL error while reading data from the socket \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+H\+T\+T\+P-\/\+E\+R\+R\+OR} & Invalid H\+T\+TP data was received\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item The {\ttfamily \char`\"{}\+Transfer-\/\+Encoding\+: chunked\char`\"{}} header is automatically set with this method if no {\ttfamily \char`\"{}\+Transfer-\/\+Encoding\char`\"{}} header is already present
\item if a response is received while the chunked send operation is still in progress, an error is assumed, the send operation is aborted, and the response header is read immediately and the {\ttfamily send\+\_\+aborted} flag is set in the argument to {\itshape rcb} 
\item For possible exceptions when implicitly establishing a connection, see the \mbox{\hyperlink{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b}{Socket\+::connect()}} method (or \mbox{\hyperlink{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5}{Socket\+::connect\+S\+S\+L()}} for secure connections)
\end{DoxyItemize}
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_httpclient_get_with_body}{H\+T\+TP G\+ET Requests With a Message Body}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
\mbox{\hyperlink{namespace_qore}{Qore}} 0.\+8.\+10 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_af175eaef12aedc1759dd0a9dd2965e9f}\label{class_qore_1_1_h_t_t_p_client_af175eaef12aedc1759dd0a9dd2965e9f}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!send\+With\+Recv\+Callback@{send\+With\+Recv\+Callback}}
\index{send\+With\+Recv\+Callback@{send\+With\+Recv\+Callback}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{send\+With\+Recv\+Callback()}{sendWithRecvCallback()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::send\+With\+Recv\+Callback (\begin{DoxyParamCaption}\item[{code}]{rcb,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{body,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{method,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{path,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}}}]{headers,  }\item[{timeout}]{timeout\+\_\+ms = {\ttfamily 0},  }\item[{softbool}]{getbody = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}},  }\item[{\+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$}]{info }\end{DoxyParamCaption})}



Sends an H\+T\+TP request with the specified method and optional message body; headers and any body received are returned through a receive callback. 

This method is useful for receiving chunked message data in real time; chunks are sent to the receive callback as soon as they are received. If a connection has not already been established, an internal call to \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a6df282a9db795b68ac5332f2429c4e8e}{H\+T\+T\+P\+Client\+::connect()}} will be made before sending the message

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.sendWithRecvCallback(rcv\_callback, data, \textcolor{stringliteral}{"POST"}, \textcolor{stringliteral}{"/path"}, (\textcolor{stringliteral}{"Content-Type"}:\textcolor{stringliteral}{"application/x-yaml"}))
      ;
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em rcb} & The receive callback for the data received; first this method is called with a hash of the message headers, and then with any message body; if a chunked H\+T\+TP message is received, then the callback is called once for each chunk; when the message has been received, then the receive callback is called with a hash representing any trailer data received in a chunked transfer or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if the data was received in a normal message body or if there was no trailer data in a chunked transfer. The argument to this callback is always a hash; data calls have the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily \char`\"{}data\char`\"{}}\+: the string or binary data
\item {\ttfamily \char`\"{}chunked\char`\"{}}\+: True if the data was received with chunked transfer encoding, False if not
\end{DoxyItemize}Header or trailer data is placed in a hash with the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily \char`\"{}hdr\char`\"{}}\+: this can be assigned to \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} for the trailer hash if the data was not sent chunked or no trailers were included in a chunked message
\item {\ttfamily \char`\"{}obj\char`\"{}}\+: this is the owning object (so socket parameters can be changed based on headers received, such as, for example, socket character encoding) 
\end{DoxyItemize}\\
\hline
{\em body} & The message body to send \\
\hline
{\em method} & The name of the H\+T\+TP method ({\ttfamily \char`\"{}\+G\+E\+T\char`\"{}}, {\ttfamily \char`\"{}\+P\+O\+S\+T\char`\"{}}, {\ttfamily \char`\"{}\+H\+E\+A\+D\char`\"{}}, {\ttfamily \char`\"{}\+O\+P\+T\+I\+O\+N\+S\char`\"{}}, {\ttfamily \char`\"{}\+P\+U\+T\char`\"{}}, {\ttfamily \char`\"{}\+D\+E\+L\+E\+T\+E\char`\"{}}, {\ttfamily \char`\"{}\+T\+R\+A\+C\+E\char`\"{}}, {\ttfamily \char`\"{}\+C\+O\+N\+N\+E\+C\+T\char`\"{}}, or {\ttfamily \char`\"{}\+P\+A\+T\+C\+H\char`\"{}}). Additional methods can be added in the constructor with the a {\ttfamily additional\+\_\+methods} option. \\
\hline
{\em path} & The path for the message (i.\+e. {\ttfamily \char`\"{}/path/resource?method\&param=value\char`\"{}}) \\
\hline
{\em headers} & An optional hash of headers to include in the message; values are converted to strings; a list is converted to a string of comma-\/separated values; headers that differ only in case will be overwritten by the last header in the hash with a matching name with a case-\/insensitive search \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds for the socket I/O operations; 0 means use the default timeout value \\
\hline
{\em getbody} & If this argument is \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}, then the object will try to receive a message body even if no {\ttfamily \char`\"{}\+Content-\/\+Length\char`\"{}} header is present in the response. Use this only with broken servers that send message bodies without a {\ttfamily \char`\"{}\+Content-\/\+Length\char`\"{}} header. \\
\hline
{\em info} & An optional reference to an lvalue that will be used as an output variable giving a hash of request headers and other information about the H\+T\+TP request; this hash contains the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily accept-\/charset}\+: this key will be set to an appropriate value from any {\ttfamily \char`\"{}\+Accept-\/\+Charset\char`\"{}} header; if any of {\ttfamily \char`\"{}$\ast$\char`\"{}}, {\ttfamily \char`\"{}utf8\char`\"{}}, or {\ttfamily \char`\"{}utf-\/8\char`\"{}} are present, then this will be set to {\ttfamily \char`\"{}utf8\char`\"{}}, otherwise it will be set to the first requested character encoding in the list
\item {\ttfamily charset\+:} if there is a {\ttfamily \char`\"{}charset\char`\"{}} declaration in the {\ttfamily \char`\"{}\+Content-\/\+Type\char`\"{}} header, the value is returned in this key
\item {\ttfamily body-\/content-\/type}\+: the outgoing message body M\+I\+ME {\ttfamily Content-\/\+Type} value
\item {\ttfamily headers\+:} a hash of outgoing H\+T\+TP request headers (returned as sent, without any case conversions)
\item {\ttfamily request-\/uri}\+: the request U\+RI string sent (ex\+: {\ttfamily \char`\"{}\+G\+E\+T /services/async/38.\+0/job H\+T\+T\+P/1.\+1\char`\"{}})
\item {\ttfamily request-\/body}\+: the raw message body in the request (before any content encoding)
\item {\ttfamily response-\/body}\+: the raw message body in the response (after any content decoding)
\item {\ttfamily response-\/headers}\+: a hash of incoming H\+T\+TP headers in the response with keys converted to all lower case for each header in the response message, plus the following Qore-\/provided keys\+:
\begin{DoxyItemize}
\item {\ttfamily http\+\_\+version\+:} the H\+T\+TP version in the response U\+RI
\item {\ttfamily status\+\_\+code\+:} the H\+T\+TP status code of the response
\item {\ttfamily status\+\_\+message\+:} the H\+T\+TP status message of the response
\end{DoxyItemize}
\item {\ttfamily response-\/uri}\+: the H\+T\+TP response U\+RI
\end{DoxyItemize}\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+M\+E\+T\+H\+O\+D-\/\+E\+R\+R\+OR} & invalid/unknown H\+T\+TP method passed \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+D\+I\+R\+E\+C\+T-\/\+E\+R\+R\+OR} & invalid redirect location given by remote \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+M\+A\+X\+I\+M\+U\+M-\/\+R\+E\+D\+I\+R\+E\+C\+T\+S-\/\+E\+X\+C\+E\+E\+D\+ED} & maximum redirect count exceeded \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+C\+E\+I\+V\+E-\/\+E\+R\+R\+OR} & unknown content encoding received \\
\hline
{\em E\+N\+C\+O\+D\+I\+N\+G-\/\+C\+O\+N\+V\+E\+R\+S\+I\+O\+N-\/\+E\+R\+R\+OR} & the given string could not be converted to the socket\textquotesingle{}s character encoding \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+E\+N\+D-\/\+E\+R\+R\+OR} & There was an error sending the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+C\+L\+O\+S\+ED} & The remote end closed the connection \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+R\+E\+C\+V-\/\+E\+R\+R\+OR} & There was an error receiving the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+T\+I\+M\+E\+O\+UT} & Data transmission or reception for a single \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{send()}} or \mbox{\hyperlink{class_qore_1_1_socket_adba4badd712c161df1b2da87e528ecb8}{recv()}} action exceeded the timeout period \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+S\+L-\/\+E\+R\+R\+OR} & There was an S\+SL error while reading data from the socket \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+H\+T\+T\+P-\/\+E\+R\+R\+OR} & Invalid H\+T\+TP data was received\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
For possible exceptions when implicitly establishing a connection, see the \mbox{\hyperlink{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b}{Socket\+::connect()}} method (or \mbox{\hyperlink{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5}{Socket\+::connect\+S\+S\+L()}} for secure connections)
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_httpclient_get_with_body}{H\+T\+TP G\+ET Requests With a Message Body}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
\mbox{\hyperlink{namespace_qore}{Qore}} 0.\+8.\+10 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a5cac0bbb948e6dea7de999fd7844e0b5}\label{class_qore_1_1_h_t_t_p_client_a5cac0bbb948e6dea7de999fd7844e0b5}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!send\+With\+Recv\+Callback@{send\+With\+Recv\+Callback}}
\index{send\+With\+Recv\+Callback@{send\+With\+Recv\+Callback}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{send\+With\+Recv\+Callback()}{sendWithRecvCallback()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::send\+With\+Recv\+Callback (\begin{DoxyParamCaption}\item[{code}]{rcb,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}}}]{body,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{method,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{path,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}}}]{headers,  }\item[{timeout}]{timeout\+\_\+ms = {\ttfamily 0},  }\item[{softbool}]{getbody = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}},  }\item[{\+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$}]{info }\end{DoxyParamCaption})}



Sends an H\+T\+TP request with the specified method and optional message body; headers and any body received are returned through a receive callback. 

This method is useful for receiving chunked message data in real time; chunks are sent to the receive callback as soon as they are received. If a connection has not already been established, an internal call to \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a6df282a9db795b68ac5332f2429c4e8e}{H\+T\+T\+P\+Client\+::connect()}} will be made before sending the message

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.sendWithRecvCallback(rcv\_callback, data, \textcolor{stringliteral}{"POST"}, \textcolor{stringliteral}{"/path"}, (\textcolor{stringliteral}{"Content-Type"}:\textcolor{stringliteral}{"application/x-yaml"}))
      ;
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em rcb} & The receive callback for the data received; first this method is called with a hash of the message headers, and then with any message body; if a chunked H\+T\+TP message is received, then the callback is called once for each chunk; when the message has been received, then the receive callback is called with a hash representing any trailer data received in a chunked transfer or \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} if the data was received in a normal message body or if there was no trailer data in a chunked transfer. The argument to this callback is always a hash; data calls have the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily \char`\"{}data\char`\"{}}\+: the string or binary data
\item {\ttfamily \char`\"{}chunked\char`\"{}}\+: True if the data was received with chunked transfer encoding, False if not
\end{DoxyItemize}Header or trailer data is placed in a hash with the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily \char`\"{}hdr\char`\"{}}\+: this can be assigned to \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} for the trailer hash if the data was not sent chunked or no trailers were included in a chunked message
\item {\ttfamily \char`\"{}obj\char`\"{}}\+: this is the owning object (so socket parameters can be changed based on headers received, such as, for example, socket character encoding) 
\end{DoxyItemize}\\
\hline
{\em body} & The message body to send; pass \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} (no value) to send no body \\
\hline
{\em method} & The name of the H\+T\+TP method ({\ttfamily \char`\"{}\+G\+E\+T\char`\"{}}, {\ttfamily \char`\"{}\+P\+O\+S\+T\char`\"{}}, {\ttfamily \char`\"{}\+H\+E\+A\+D\char`\"{}}, {\ttfamily \char`\"{}\+O\+P\+T\+I\+O\+N\+S\char`\"{}}, {\ttfamily \char`\"{}\+P\+U\+T\char`\"{}}, {\ttfamily \char`\"{}\+D\+E\+L\+E\+T\+E\char`\"{}}, {\ttfamily \char`\"{}\+T\+R\+A\+C\+E\char`\"{}}, {\ttfamily \char`\"{}\+C\+O\+N\+N\+E\+C\+T\char`\"{}}, or {\ttfamily \char`\"{}\+P\+A\+T\+C\+H\char`\"{}}). Additional methods can be added in the constructor with the a {\ttfamily additional\+\_\+methods} option. \\
\hline
{\em path} & The path for the message (i.\+e. {\ttfamily \char`\"{}/path/resource?method\&param=value\char`\"{}}) \\
\hline
{\em headers} & An optional hash of headers to include in the message; values are converted to strings; a list is converted to a string of comma-\/separated values; headers that differ only in case will be overwritten by the last header in the hash with a matching name with a case-\/insensitive search \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds for the socket I/O operations; 0 means use the default timeout value \\
\hline
{\em getbody} & If this argument is \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}, then the object will try to receive a message body even if no {\ttfamily \char`\"{}\+Content-\/\+Length\char`\"{}} header is present in the response. Use this only with broken servers that send message bodies without a {\ttfamily \char`\"{}\+Content-\/\+Length\char`\"{}} header. \\
\hline
{\em info} & An optional reference to an lvalue that will be used as an output variable giving a hash of request headers and other information about the H\+T\+TP request; this hash contains the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily accept-\/charset}\+: this key will be set to an appropriate value from any {\ttfamily \char`\"{}\+Accept-\/\+Charset\char`\"{}} header; if any of {\ttfamily \char`\"{}$\ast$\char`\"{}}, {\ttfamily \char`\"{}utf8\char`\"{}}, or {\ttfamily \char`\"{}utf-\/8\char`\"{}} are present, then this will be set to {\ttfamily \char`\"{}utf8\char`\"{}}, otherwise it will be set to the first requested character encoding in the list
\item {\ttfamily charset\+:} if there is a {\ttfamily \char`\"{}charset\char`\"{}} declaration in the {\ttfamily \char`\"{}\+Content-\/\+Type\char`\"{}} header, the value is returned in this key
\item {\ttfamily body-\/content-\/type}\+: the outgoing message body M\+I\+ME {\ttfamily Content-\/\+Type} value
\item {\ttfamily headers\+:} a hash of outgoing H\+T\+TP request headers (returned as sent, without any case conversions)
\item {\ttfamily request-\/uri}\+: the request U\+RI string sent (ex\+: {\ttfamily \char`\"{}\+G\+E\+T /services/async/38.\+0/job H\+T\+T\+P/1.\+1\char`\"{}})
\item {\ttfamily request-\/body}\+: the raw message body in the request (before any content encoding)
\item {\ttfamily response-\/body}\+: the raw message body in the response (after any content decoding)
\item {\ttfamily response-\/headers}\+: a hash of incoming H\+T\+TP headers in the response with keys converted to all lower case for each header in the response message, plus the following Qore-\/provided keys\+:
\begin{DoxyItemize}
\item {\ttfamily http\+\_\+version\+:} the H\+T\+TP version in the response U\+RI
\item {\ttfamily status\+\_\+code\+:} the H\+T\+TP status code of the response
\item {\ttfamily status\+\_\+message\+:} the H\+T\+TP status message of the response
\end{DoxyItemize}
\item {\ttfamily response-\/uri}\+: the H\+T\+TP response U\+RI
\end{DoxyItemize}\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+M\+E\+T\+H\+O\+D-\/\+E\+R\+R\+OR} & invalid/unknown H\+T\+TP method passed \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+D\+I\+R\+E\+C\+T-\/\+E\+R\+R\+OR} & invalid redirect location given by remote \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+M\+A\+X\+I\+M\+U\+M-\/\+R\+E\+D\+I\+R\+E\+C\+T\+S-\/\+E\+X\+C\+E\+E\+D\+ED} & maximum redirect count exceeded \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+C\+E\+I\+V\+E-\/\+E\+R\+R\+OR} & unknown content encoding received \\
\hline
{\em E\+N\+C\+O\+D\+I\+N\+G-\/\+C\+O\+N\+V\+E\+R\+S\+I\+O\+N-\/\+E\+R\+R\+OR} & the given string could not be converted to the socket\textquotesingle{}s character encoding \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+E\+N\+D-\/\+E\+R\+R\+OR} & There was an error sending the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+C\+L\+O\+S\+ED} & The remote end closed the connection \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+R\+E\+C\+V-\/\+E\+R\+R\+OR} & There was an error receiving the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+T\+I\+M\+E\+O\+UT} & Data transmission or reception for a single \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{send()}} or \mbox{\hyperlink{class_qore_1_1_socket_adba4badd712c161df1b2da87e528ecb8}{recv()}} action exceeded the timeout period \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+S\+L-\/\+E\+R\+R\+OR} & There was an S\+SL error while reading data from the socket \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+H\+T\+T\+P-\/\+E\+R\+R\+OR} & Invalid H\+T\+TP data was received\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
For possible exceptions when implicitly establishing a connection, see the \mbox{\hyperlink{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b}{Socket\+::connect()}} method (or \mbox{\hyperlink{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5}{Socket\+::connect\+S\+S\+L()}} for secure connections)
\end{DoxyNote}
\begin{DoxySince}{Since}
\mbox{\hyperlink{namespace_qore}{Qore}} 0.\+8.\+10 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_af9be5b81abf6192ea802e4c4cdecb284}\label{class_qore_1_1_h_t_t_p_client_af9be5b81abf6192ea802e4c4cdecb284}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!send\+With\+Send\+Callback@{send\+With\+Send\+Callback}}
\index{send\+With\+Send\+Callback@{send\+With\+Send\+Callback}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{send\+With\+Send\+Callback()}{sendWithSendCallback()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} Qore\+::\+H\+T\+T\+P\+Client\+::send\+With\+Send\+Callback (\begin{DoxyParamCaption}\item[{code}]{scb,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{method,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{path,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}}}]{headers,  }\item[{timeout}]{timeout\+\_\+ms = {\ttfamily 0},  }\item[{softbool}]{getbody = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}},  }\item[{\+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_ga5182bb860e3837e1eb337e85a9b3ebd6}{hash}} $>$}]{info }\end{DoxyParamCaption})}



Sends an H\+T\+TP request with the specified method and chunked message body as given by a send callback and returns headers and any body received as a response in a hash format. 

If a connection has not already been established, an internal call to \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a6df282a9db795b68ac5332f2429c4e8e}{H\+T\+T\+P\+Client\+::connect()}} will be made before sending the message

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
hash msg = httpclient.sendWithSendCallback(callback, \textcolor{stringliteral}{"POST"}, \textcolor{stringliteral}{"/path"}, (\textcolor{stringliteral}{"Content-Type"}:\textcolor{stringliteral}{"application/x-yaml"})
      );
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em scb} & The callback giving the chunked H\+T\+TP data to send; this callback must return either a string or a binary value each time it is called to give the chunked data to send; when all data has been sent, then a hash of message trailers can be sent or simply \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} which will close the chunked message \\
\hline
{\em method} & The name of the H\+T\+TP method ({\ttfamily \char`\"{}\+G\+E\+T\char`\"{}}, {\ttfamily \char`\"{}\+P\+O\+S\+T\char`\"{}}, {\ttfamily \char`\"{}\+H\+E\+A\+D\char`\"{}}, {\ttfamily \char`\"{}\+O\+P\+T\+I\+O\+N\+S\char`\"{}}, {\ttfamily \char`\"{}\+P\+U\+T\char`\"{}}, {\ttfamily \char`\"{}\+D\+E\+L\+E\+T\+E\char`\"{}}, {\ttfamily \char`\"{}\+T\+R\+A\+C\+E\char`\"{}}, {\ttfamily \char`\"{}\+C\+O\+N\+N\+E\+C\+T\char`\"{}}, or {\ttfamily \char`\"{}\+P\+A\+T\+C\+H\char`\"{}}). Additional methods can be added in the constructor with the a {\ttfamily additional\+\_\+methods} option. \\
\hline
{\em path} & The path for the message (i.\+e. {\ttfamily \char`\"{}/path/resource?method\&param=value\char`\"{}}) \\
\hline
{\em headers} & An optional hash of headers to include in the message; values are converted to strings; a list is converted to a string of comma-\/separated values; headers that differ only in case will be overwritten by the last header in the hash with a matching name with a case-\/insensitive search \\
\hline
{\em timeout\+\_\+ms} & the timeout in milliseconds for the socket I/O operations; 0 means use the default timeout value \\
\hline
{\em getbody} & If this argument is \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}, then the object will try to receive a message body even if no {\ttfamily \char`\"{}\+Content-\/\+Length\char`\"{}} header is present in the response. Use this only with broken servers that send message bodies without a {\ttfamily \char`\"{}\+Content-\/\+Length\char`\"{}} header. \\
\hline
{\em info} & An optional reference to an lvalue that will be used as an output variable giving a hash of request headers and other information about the H\+T\+TP request; this hash contains the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily accept-\/charset}\+: this key will be set to an appropriate value from any {\ttfamily \char`\"{}\+Accept-\/\+Charset\char`\"{}} header; if any of {\ttfamily \char`\"{}$\ast$\char`\"{}}, {\ttfamily \char`\"{}utf8\char`\"{}}, or {\ttfamily \char`\"{}utf-\/8\char`\"{}} are present, then this will be set to {\ttfamily \char`\"{}utf8\char`\"{}}, otherwise it will be set to the first requested character encoding in the list
\item {\ttfamily charset\+:} if there is a {\ttfamily \char`\"{}charset\char`\"{}} declaration in the {\ttfamily \char`\"{}\+Content-\/\+Type\char`\"{}} header, the value is returned in this key
\item {\ttfamily body-\/content-\/type}\+: the outgoing message body M\+I\+ME {\ttfamily Content-\/\+Type} value
\item {\ttfamily headers\+:} a hash of outgoing H\+T\+TP request headers (returned as sent, without any case conversions)
\item {\ttfamily request-\/uri}\+: the request U\+RI string sent (ex\+: {\ttfamily \char`\"{}\+G\+E\+T /services/async/38.\+0/job H\+T\+T\+P/1.\+1\char`\"{}})
\item {\ttfamily request-\/body}\+: the raw message body in the request (before any content encoding)
\item {\ttfamily response-\/body}\+: the raw message body in the response (after any content decoding)
\item {\ttfamily response-\/headers}\+: a hash of incoming H\+T\+TP headers in the response with keys converted to all lower case for each header in the response message, plus the following Qore-\/provided keys\+:
\begin{DoxyItemize}
\item {\ttfamily http\+\_\+version\+:} the H\+T\+TP version in the response U\+RI
\item {\ttfamily status\+\_\+code\+:} the H\+T\+TP status code of the response
\item {\ttfamily status\+\_\+message\+:} the H\+T\+TP status message of the response
\end{DoxyItemize}
\item {\ttfamily response-\/uri}\+: the H\+T\+TP response U\+RI
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The headers received from the H\+T\+TP server with all key names converted to lower-\/case. The message body (if any) will be assigned to the value of the {\ttfamily \char`\"{}body\char`\"{}} key and the H\+T\+TP status will be assigned to the {\ttfamily \char`\"{}status\+\_\+code\char`\"{}} key.
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+M\+E\+T\+H\+O\+D-\/\+E\+R\+R\+OR} & invalid/unknown H\+T\+TP method passed \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+D\+I\+R\+E\+C\+T-\/\+E\+R\+R\+OR} & invalid redirect location given by remote \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+M\+A\+X\+I\+M\+U\+M-\/\+R\+E\+D\+I\+R\+E\+C\+T\+S-\/\+E\+X\+C\+E\+E\+D\+ED} & maximum redirect count exceeded \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+R\+E\+C\+E\+I\+V\+E-\/\+E\+R\+R\+OR} & unknown content encoding received or status error communicating with H\+T\+TP server (status code $<$ 100 or $>$ 299); in case of a status error the {\ttfamily \char`\"{}arg\char`\"{}} key of the exception hash will be set to a hash equal to the normal return value of this method including a {\ttfamily \char`\"{}status\+\_\+code\char`\"{}} key (giving the status code) and a {\ttfamily \char`\"{}body\char`\"{}} key (giving the message body returned by the server) \\
\hline
{\em E\+N\+C\+O\+D\+I\+N\+G-\/\+C\+O\+N\+V\+E\+R\+S\+I\+O\+N-\/\+E\+R\+R\+OR} & the given string could not be converted to the socket\textquotesingle{}s character encoding \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+E\+N\+D-\/\+E\+R\+R\+OR} & There was an error sending the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+C\+L\+O\+S\+ED} & The remote end closed the connection \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+R\+E\+C\+V-\/\+E\+R\+R\+OR} & There was an error receiving the data \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+T\+I\+M\+E\+O\+UT} & Data transmission or reception for a single \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae1f4636690926617d710f78cbf48e4f9}{send()}} or \mbox{\hyperlink{class_qore_1_1_socket_adba4badd712c161df1b2da87e528ecb8}{recv()}} action exceeded the timeout period \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+S\+L-\/\+E\+R\+R\+OR} & There was an S\+SL error while reading data from the socket \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+H\+T\+T\+P-\/\+E\+R\+R\+OR} & Invalid H\+T\+TP data was received\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item The {\ttfamily \char`\"{}\+Transfer-\/\+Encoding\+: chunked\char`\"{}} header is automatically set with this method if no {\ttfamily \char`\"{}\+Transfer-\/\+Encoding\char`\"{}} header is already present
\item For possible exceptions when implicitly establishing a connection, see the \mbox{\hyperlink{class_qore_1_1_socket_a7e0dc386a95c3c6a0e1cc12269d4374b}{Socket\+::connect()}} method (or \mbox{\hyperlink{class_qore_1_1_socket_a3d64c129d67687ab0e00b96b495059c5}{Socket\+::connect\+S\+S\+L()}} for secure connections)
\end{DoxyItemize}
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_httpclient_get_with_body}{H\+T\+TP G\+ET Requests With a Message Body}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
\mbox{\hyperlink{namespace_qore}{Qore}} 0.\+8.\+10 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a59c32a1cb1c23f5616a57c7b349521ef}\label{class_qore_1_1_h_t_t_p_client_a59c32a1cb1c23f5616a57c7b349521ef}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!set\+Connect\+Timeout@{set\+Connect\+Timeout}}
\index{set\+Connect\+Timeout@{set\+Connect\+Timeout}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{set\+Connect\+Timeout()}{setConnectTimeout()}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::set\+Connect\+Timeout (\begin{DoxyParamCaption}\item[{timeout}]{timeout\+\_\+ms = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Sets the connect timeout in milliseconds. 


\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & the connect timeout in milliseconds; negative numbers mean use the default system connect timeout. Note that like all Qore functions and methods taking timeout values, a \mbox{\hyperlink{basic_data_types_relative_dates}{relative date/time value}} can be used to make the units clear (i.\+e. {\ttfamily 30s} = 30 seconds, etc.).\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.setConnectTimeout(2m);
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a7d57e49bdde9c6fa2d67013f3fb0a4c8}\label{class_qore_1_1_h_t_t_p_client_a7d57e49bdde9c6fa2d67013f3fb0a4c8}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!set\+Default\+Path@{set\+Default\+Path}}
\index{set\+Default\+Path@{set\+Default\+Path}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{set\+Default\+Path()}{setDefaultPath()}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::set\+Default\+Path (\begin{DoxyParamCaption}\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{path }\end{DoxyParamCaption})}



Sets the default path used by the object if no path is set in the U\+RL. 


\begin{DoxyParams}{Parameters}
{\em path} & the default path value to set or if \mbox{\hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG}} then clears the path\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.setDefaultPath();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a79ec21def4e2015d6da8b2a5d71e9b0e}\label{class_qore_1_1_h_t_t_p_client_a79ec21def4e2015d6da8b2a5d71e9b0e}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!set\+Encoding@{set\+Encoding}}
\index{set\+Encoding@{set\+Encoding}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{set\+Encoding()}{setEncoding()}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::set\+Encoding (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{encoding }\end{DoxyParamCaption})}



Sets the string encoding for the object; any strings deserialized with this object will be tagged with this character encoding. 


\begin{DoxyParams}{Parameters}
{\em encoding} & the string encoding for the object; any strings deserialized with this object will be tagged with this character encoding\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.setEncoding(\textcolor{stringliteral}{"UTF-8"});
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_af48e59604f6e7da844c79ac958b45f6a}\label{class_qore_1_1_h_t_t_p_client_af48e59604f6e7da844c79ac958b45f6a}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!set\+Event\+Queue@{set\+Event\+Queue}}
\index{set\+Event\+Queue@{set\+Event\+Queue}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{set\+Event\+Queue()}{setEventQueue()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::set\+Event\+Queue (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Clears any Queue object that may be set on the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} object so that \mbox{\hyperlink{event_handling}{I/O events}} are no longer captured on the object. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.setEventQueue();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a1db25c4d7a84777c90e2cc44d5405212}\label{class_qore_1_1_h_t_t_p_client_a1db25c4d7a84777c90e2cc44d5405212}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!set\+Event\+Queue@{set\+Event\+Queue}}
\index{set\+Event\+Queue@{set\+Event\+Queue}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{set\+Event\+Queue()}{setEventQueue()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::set\+Event\+Queue (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_qore_1_1_thread_1_1_queue}{Qore\+::\+Thread\+::\+Queue}}}]{queue }\end{DoxyParamCaption})}



Sets a Queue object to receive \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} and \mbox{\hyperlink{class_qore_1_1_socket}{Socket}} events. 


\begin{DoxyParams}{Parameters}
{\em queue} & a \mbox{\hyperlink{class_qore_1_1_thread_1_1_queue}{Queue}} object to receive \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} and \mbox{\hyperlink{class_qore_1_1_socket}{Socket}} events; note that the Queue passed cannot have any maximum size set or a Q\+U\+E\+U\+E-\/\+E\+R\+R\+OR will be thrown\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.setEventQueue(queue);
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em Q\+U\+E\+U\+E-\/\+E\+R\+R\+OR} & the Queue passed has a maximum size set\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
event\+\_\+handling for more information 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a123efcd92e5d648856435f3fa445d620}\label{class_qore_1_1_h_t_t_p_client_a123efcd92e5d648856435f3fa445d620}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!set\+H\+T\+T\+P\+Version@{set\+H\+T\+T\+P\+Version}}
\index{set\+H\+T\+T\+P\+Version@{set\+H\+T\+T\+P\+Version}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{set\+H\+T\+T\+P\+Version()}{setHTTPVersion()}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::set\+H\+T\+T\+P\+Version (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{ver }\end{DoxyParamCaption})}



Sets the H\+T\+TP protocol version string for headers in outgoing messages, allowed values are {\ttfamily \char`\"{}1.\+0\char`\"{}} and "1.\+1". 


\begin{DoxyParams}{Parameters}
{\em ver} & {\ttfamily \char`\"{}1.\+0\char`\"{}} or "1.\+1" for the H\+T\+TP protocol compliance version\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.setHTTPVersion(\textcolor{stringliteral}{"1.1"});
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em H\+T\+T\+P-\/\+V\+E\+R\+S\+I\+O\+N-\/\+E\+R\+R\+OR} & invalid H\+T\+TP version passed (allowed values\+: {\ttfamily \char`\"{}1.\+0\char`\"{}} and "1.\+1") \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_aea1c09e972256088465cacc56019906e}\label{class_qore_1_1_h_t_t_p_client_aea1c09e972256088465cacc56019906e}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!set\+Max\+Redirects@{set\+Max\+Redirects}}
\index{set\+Max\+Redirects@{set\+Max\+Redirects}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{set\+Max\+Redirects()}{setMaxRedirects()}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::set\+Max\+Redirects (\begin{DoxyParamCaption}\item[{softint}]{mr = {\ttfamily 0} }\end{DoxyParamCaption})}



Updates the setting for the {\ttfamily max\+\_\+redirects} value for the object (maximum number of H\+T\+TP redirects that will be processed before an exception is raised) 


\begin{DoxyParams}{Parameters}
{\em mr} & the setting for the maximum number of H\+T\+TP redirects that will be processed before an exception is raised\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.setMaxRedirects(5);
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_afbb1c7d48fc1b1dcba32e1051041bfae}{H\+T\+T\+P\+Client\+::get\+Max\+Redirects()}} to retrieve this value 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_ae6d797291f0f87d5243e40d2f8ea2bb7}\label{class_qore_1_1_h_t_t_p_client_ae6d797291f0f87d5243e40d2f8ea2bb7}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!set\+No\+Delay@{set\+No\+Delay}}
\index{set\+No\+Delay@{set\+No\+Delay}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{set\+No\+Delay()}{setNoDelay()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+H\+T\+T\+P\+Client\+::set\+No\+Delay (\begin{DoxyParamCaption}\item[{softbool}]{b = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}} }\end{DoxyParamCaption})}



Sets the {\ttfamily T\+C\+P\+\_\+\+N\+O\+D\+E\+L\+AY} setting for the object. 

When this setting is True, then data will be immediately sent out over the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} object\textquotesingle{}s socket, when it is \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}, then data transmission may be delayed to be packaged with other data for the same target.

Delayed data transmissions may cause problems when the sender immediately closes the socket after sending data; in this case the receiver may not get the data even though the send succeeded.

Note that if no value is given to the method, the argument will be assumed to be \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}, and output buffering will be turned off for the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client}{H\+T\+T\+P\+Client}} object.

If the socket is not connected when this call is made, then an internal flag is set and the {\ttfamily T\+C\+P\+\_\+\+N\+O\+D\+E\+L\+AY} option is enabled when the next connection is established. If the socket is connected, then if an error occurs setting the {\ttfamily T\+C\+P\+\_\+\+N\+O\+D\+E\+L\+AY} option on the socket, this method will return a non-\/zero error code; the actual error can be checked with the \mbox{\hyperlink{group__library__functions_gabcf45c25ca1234fc8c54761750324cda}{errno()}} function.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.setNoDelay(\textcolor{keyword}{True});
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em b} & the {\ttfamily T\+C\+P\+\_\+\+N\+O\+D\+E\+L\+AY} setting for the object\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a3f9632f945cdd1df380d2831e73c924b}{H\+T\+T\+P\+Client\+::get\+No\+Delay()}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a2e3bd5ea66d056b0a3f69b4d0e86964e}\label{class_qore_1_1_h_t_t_p_client_a2e3bd5ea66d056b0a3f69b4d0e86964e}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!set\+Persistent@{set\+Persistent}}
\index{set\+Persistent@{set\+Persistent}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{set\+Persistent()}{setPersistent()}}
{\footnotesize\ttfamily Qore\+::\+H\+T\+T\+P\+Client\+::set\+Persistent (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



temporarily disables implicit reconnections; must be called when the server is already connected 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.connect();
httpclient.setPersistent();
\end{DoxyCode}

\end{DoxyParagraph}
The persistent flag is automatically reset to \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}} whenever the connection is closed; it must be called manually for every connection to turn off implicit reconnections.

To turn off the persistent flag manually, call \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_aeaa701096e2089dd42de81fb177730e9}{H\+T\+T\+P\+Client\+::disconnect()}}

\begin{DoxySince}{Since}
\mbox{\hyperlink{namespace_qore}{Qore}} 0.\+8.\+10 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_ae58ff38024846050d5be3f6b36952c90}\label{class_qore_1_1_h_t_t_p_client_ae58ff38024846050d5be3f6b36952c90}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!set\+Proxy\+Secure@{set\+Proxy\+Secure}}
\index{set\+Proxy\+Secure@{set\+Proxy\+Secure}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{set\+Proxy\+Secure()}{setProxySecure()}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::set\+Proxy\+Secure (\begin{DoxyParamCaption}\item[{softbool}]{b = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}} }\end{DoxyParamCaption})}



Sets the S\+S\+L/\+T\+LS flag for the next connection to the proxy. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.setProxySecure(\textcolor{keyword}{True});
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a04c2df5e6fca680874e388a093fa136a}{H\+T\+T\+P\+Client\+::is\+Proxy\+Secure()}} to check the flag 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_aef070595f39138c8d0d9f20ac47b6ac0}\label{class_qore_1_1_h_t_t_p_client_aef070595f39138c8d0d9f20ac47b6ac0}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!set\+Proxy\+U\+RL@{set\+Proxy\+U\+RL}}
\index{set\+Proxy\+U\+RL@{set\+Proxy\+U\+RL}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{set\+Proxy\+U\+R\+L()}{setProxyURL()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::set\+Proxy\+U\+RL (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Clears the new proxy U\+RL value for the next connection. 

This variant of the method is equivalent to \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ad7688922670e2c8795a1ee680a2d51e3}{H\+T\+T\+P\+Client\+::clear\+Proxy\+U\+R\+L()}}

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.setProxyURL();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a27075d22526b650fdee997932cc1b658}\label{class_qore_1_1_h_t_t_p_client_a27075d22526b650fdee997932cc1b658}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!set\+Proxy\+U\+RL@{set\+Proxy\+U\+RL}}
\index{set\+Proxy\+U\+RL@{set\+Proxy\+U\+RL}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{set\+Proxy\+U\+R\+L()}{setProxyURL()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::set\+Proxy\+U\+RL (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{url }\end{DoxyParamCaption})}



Sets a new proxy U\+RL value for the next connection. 


\begin{DoxyParams}{Parameters}
{\em url} & the new proxy U\+RL value for the next connection\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.setProxyURL(\textcolor{stringliteral}{"http://user:password@proxy\_host:8080/path"});
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+U\+R\+L-\/\+E\+R\+R\+OR} & invalid proxy U\+RL string; invalid authorization credentials in proxy U\+RL (username without password or vice-\/versa) \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+P\+R\+O\+X\+Y-\/\+P\+R\+O\+T\+O\+C\+O\+L-\/\+E\+R\+R\+OR} & unknown protocol passed in U\+RL\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
U\+R\+Ls with U\+N\+IX sockets are generally supported in \mbox{\hyperlink{namespace_qore}{Qore}} with the following syntax\+: {\ttfamily {\bfseries scheme\+://socket=}}{\itshape url\+\_\+encoded\+\_\+path}{\ttfamily {\bfseries /path}}, where {\itshape url\+\_\+encoded\+\_\+path} is a path with U\+R\+L-\/encoding as performed by \mbox{\hyperlink{group__misc__functions_ga639fba8c278c69ac4d4190ca1db19235}{encode\+\_\+url(string, True)}}; for example\+: {\ttfamily \char`\"{}http\+://socket=\%2ftmp\%socket-\/dir\%2fsocket-\/file-\/1/url/path\char`\"{}}; this allows a filesystem path to be used in the host portion of the U\+RL and for the U\+RL to include a U\+RL path as well. 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_afb6865d4b0d09a03f8688a1acbe5b320}\label{class_qore_1_1_h_t_t_p_client_afb6865d4b0d09a03f8688a1acbe5b320}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!set\+Proxy\+User\+Password@{set\+Proxy\+User\+Password}}
\index{set\+Proxy\+User\+Password@{set\+Proxy\+User\+Password}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{set\+Proxy\+User\+Password()}{setProxyUserPassword()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::set\+Proxy\+User\+Password (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{user,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{pass }\end{DoxyParamCaption})}



Sets the username and password for the connection to the proxy; call after \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_aef070595f39138c8d0d9f20ac47b6ac0}{H\+T\+T\+P\+Client\+::set\+Proxy\+U\+R\+L()}} 

Call this method after calling \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_aef070595f39138c8d0d9f20ac47b6ac0}{H\+T\+T\+P\+Client\+::set\+Proxy\+U\+R\+L()}} to set proxy authentication information when not present in the U\+RL used in \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_aef070595f39138c8d0d9f20ac47b6ac0}{H\+T\+T\+P\+Client\+::set\+Proxy\+U\+R\+L()}}

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.setProxyUserPassword(user, \textcolor{keywordflow}{pass});
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em user} & the username to use for proxy authentication in the next H\+T\+TP connection \\
\hline
{\em pass} & the password to use for proxy authentication in the next H\+T\+TP connection \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_af4bccc6d03ff65bcd7e0a54c7b92e602}\label{class_qore_1_1_h_t_t_p_client_af4bccc6d03ff65bcd7e0a54c7b92e602}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!set\+Proxy\+User\+Password@{set\+Proxy\+User\+Password}}
\index{set\+Proxy\+User\+Password@{set\+Proxy\+User\+Password}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{set\+Proxy\+User\+Password()}{setProxyUserPassword()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::set\+Proxy\+User\+Password (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Clears the username and password for the next proxy connection. 

Call this method after calling \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_aef070595f39138c8d0d9f20ac47b6ac0}{H\+T\+T\+P\+Client\+::set\+Proxy\+U\+R\+L()}} to clear any proxy authentication information present in the U\+RL used in \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_aef070595f39138c8d0d9f20ac47b6ac0}{H\+T\+T\+P\+Client\+::set\+Proxy\+U\+R\+L()}}

This variant of the method is equivalent to \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ad555d0d81c335bb51820585b98888c12}{H\+T\+T\+P\+Client\+::clear\+Proxy\+User\+Password()}}

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.setProxyUserPassword();
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ad555d0d81c335bb51820585b98888c12}{H\+T\+T\+P\+Client\+::clear\+Proxy\+User\+Password()}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a5d0b8c0b6fe386efb42367d81cc20e51}\label{class_qore_1_1_h_t_t_p_client_a5d0b8c0b6fe386efb42367d81cc20e51}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!set\+Secure@{set\+Secure}}
\index{set\+Secure@{set\+Secure}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{set\+Secure()}{setSecure()}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::set\+Secure (\begin{DoxyParamCaption}\item[{softbool}]{secure = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}} }\end{DoxyParamCaption})}



Sets the object to make a secure S\+S\+L/\+T\+LS connection on the next connect if the passed argument is \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}, or an unencrypted cleartext connection if it is \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}. 

This method overrides the default behaviour for the protocol set for the object

Note that the behavior of this method when called with no argument changed in version 0.\+8.\+0; prior to version 0.\+8.\+0 calling this method with no argument would turn off secure mode; the behavior was changed to the current functionality in order to make the usage of this method consistent with other methods of the same name and to make it more logical.

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.setSecure(\textcolor{keyword}{True});
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em secure} & if \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}, a S\+S\+L/\+T\+LS connection will be attempted on the next connection. If \mbox{\hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}}, an unencrypted cleartext connection will be established \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_af55851848983f0c17a0ee2d217f6c198}\label{class_qore_1_1_h_t_t_p_client_af55851848983f0c17a0ee2d217f6c198}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!set\+Timeout@{set\+Timeout}}
\index{set\+Timeout@{set\+Timeout}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{set\+Timeout()}{setTimeout()}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::set\+Timeout (\begin{DoxyParamCaption}\item[{timeout}]{timeout\+\_\+ms = {\ttfamily 0} }\end{DoxyParamCaption})}



Sets the default I/O timeout value in milliseconds. 


\begin{DoxyParams}{Parameters}
{\em timeout\+\_\+ms} & 0 means immediate timeout (when reading will return data only if it is already available), and negative numbers mean never timeout. Note that like all Qore functions and methods taking timeout values, a \mbox{\hyperlink{basic_data_types_relative_dates}{relative date/time value}} can be used to make the units clear (i.\+e. {\ttfamily 2m} = two minutes, etc.).\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.setTimeout(2m);
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_a79d3f4dc0a39cd9afb1d30d5337e61e1}\label{class_qore_1_1_h_t_t_p_client_a79d3f4dc0a39cd9afb1d30d5337e61e1}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!set\+U\+RL@{set\+U\+RL}}
\index{set\+U\+RL@{set\+U\+RL}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{set\+U\+R\+L()}{setURL()}}
{\footnotesize\ttfamily Qore\+::\+H\+T\+T\+P\+Client\+::set\+U\+RL (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{url }\end{DoxyParamCaption})}



Sets a new U\+RL value for the next connection. 

To retrieve the current U\+RL value, use the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a9a9b553de7854b86ca978a8d10c3c9dd}{H\+T\+T\+P\+Client\+::get\+U\+R\+L()}} method

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.setURL(\textcolor{stringliteral}{"https://user:password@hostname:8080/path"});
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em url} & the new U\+RL for the object\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+U\+R\+L-\/\+E\+R\+R\+OR} & invalid U\+RL string; invalid authorization credentials in U\+RL (username without password or vice-\/versa) \\
\hline
{\em H\+T\+T\+P-\/\+C\+L\+I\+E\+N\+T-\/\+U\+N\+K\+N\+O\+W\+N-\/\+P\+R\+O\+T\+O\+C\+OL} & unknown protocol (scheme) passed in U\+RL\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a9a9b553de7854b86ca978a8d10c3c9dd}{H\+T\+T\+P\+Client\+::get\+U\+R\+L()}}
\end{DoxySeeAlso}
\begin{DoxyNote}{Note}
U\+R\+Ls with U\+N\+IX sockets are generally supported in \mbox{\hyperlink{namespace_qore}{Qore}} with the following syntax\+: {\ttfamily {\bfseries scheme\+://socket=}}{\itshape url\+\_\+encoded\+\_\+path}{\ttfamily {\bfseries /path}}, where {\itshape url\+\_\+encoded\+\_\+path} is a path with U\+R\+L-\/encoding as performed by \mbox{\hyperlink{group__misc__functions_ga639fba8c278c69ac4d4190ca1db19235}{encode\+\_\+url(string, True)}}; for example\+: {\ttfamily \char`\"{}http\+://socket=\%2ftmp\%socket-\/dir\%2fsocket-\/file-\/1/url/path\char`\"{}}; this allows a filesystem path to be used in the host portion of the U\+RL and for the U\+RL to include a U\+RL path as well. 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_aa02efa9f178f55a45da68a84bd824c71}\label{class_qore_1_1_h_t_t_p_client_aa02efa9f178f55a45da68a84bd824c71}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!set\+User\+Password@{set\+User\+Password}}
\index{set\+User\+Password@{set\+User\+Password}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{set\+User\+Password()}{setUserPassword()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::set\+User\+Password (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{user,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{pass }\end{DoxyParamCaption})}



Sets the username and password for the connection; call after \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a79d3f4dc0a39cd9afb1d30d5337e61e1}{H\+T\+T\+P\+Client\+::set\+U\+R\+L()}} 

Call this method after calling \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a79d3f4dc0a39cd9afb1d30d5337e61e1}{H\+T\+T\+P\+Client\+::set\+U\+R\+L()}} to set authentication information when not present in the U\+RL used in \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a79d3f4dc0a39cd9afb1d30d5337e61e1}{H\+T\+T\+P\+Client\+::set\+U\+R\+L()}}


\begin{DoxyParams}{Parameters}
{\em user} & the username to use for authentication in the next H\+T\+TP connection \\
\hline
{\em pass} & the password to use for authentication in the next H\+T\+TP connection\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.setUserPassword(user, \textcolor{keywordflow}{pass});
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_ab612d8a6bec649e1252515b2e78d2150}\label{class_qore_1_1_h_t_t_p_client_ab612d8a6bec649e1252515b2e78d2150}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!set\+User\+Password@{set\+User\+Password}}
\index{set\+User\+Password@{set\+User\+Password}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{set\+User\+Password()}{setUserPassword()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::set\+User\+Password (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Clears the username and password for the connection. 

Call this method after calling \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a79d3f4dc0a39cd9afb1d30d5337e61e1}{H\+T\+T\+P\+Client\+::set\+U\+R\+L()}} to clear any authentication information present in the U\+RL used in \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a79d3f4dc0a39cd9afb1d30d5337e61e1}{H\+T\+T\+P\+Client\+::set\+U\+R\+L()}}

This variant of the method is equivalent to \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a9759d21c503bea0563dd8eaf6d6cfbd1}{H\+T\+T\+P\+Client\+::clear\+User\+Password()}}

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.setUserPassword();
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a9759d21c503bea0563dd8eaf6d6cfbd1}{H\+T\+T\+P\+Client\+::clear\+User\+Password()}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_qore_1_1_h_t_t_p_client_ae2aafddbf5be67012e3b57f846c4105e}\label{class_qore_1_1_h_t_t_p_client_ae2aafddbf5be67012e3b57f846c4105e}} 
\index{Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}!set\+Warning\+Queue@{set\+Warning\+Queue}}
\index{set\+Warning\+Queue@{set\+Warning\+Queue}!Qore\+::\+H\+T\+T\+P\+Client@{Qore\+::\+H\+T\+T\+P\+Client}}
\subsubsection{\texorpdfstring{set\+Warning\+Queue()}{setWarningQueue()}}
{\footnotesize\ttfamily nothing Qore\+::\+H\+T\+T\+P\+Client\+::set\+Warning\+Queue (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{warning\+\_\+ms,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{warning\+\_\+bs,  }\item[{Queue}]{queue,  }\item[{auto}]{arg,  }\item[{timeout}]{min\+\_\+ms = {\ttfamily 1s} }\end{DoxyParamCaption})}



Sets a \mbox{\hyperlink{class_qore_1_1_thread_1_1_queue}{Queue}} object to receive socket warnings. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
httpclient.setWarningQueue(5000, 5000, queue, \textcolor{stringliteral}{"socket-1"});
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em warning\+\_\+ms} & the threshold in milliseconds for individual socket actions (send, receive, connect), if exceeded, a socket warning is placed on the warning queue with the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily \char`\"{}type\char`\"{}}\+: a string with the constant value {\ttfamily \char`\"{}\+S\+O\+C\+K\+E\+T-\/\+O\+P\+E\+R\+A\+T\+I\+O\+N-\/\+W\+A\+R\+N\+I\+N\+G\char`\"{}} 
\item {\ttfamily \char`\"{}operation\char`\"{}}\+: a string giving the operation that caused the warning (ex\+: {\ttfamily \char`\"{}connect\char`\"{}})
\item {\ttfamily \char`\"{}us\char`\"{}}\+: an integer giving the number of microseconds for the operation
\item {\ttfamily \char`\"{}timeout\char`\"{}}\+: an integer giving the warning threshold in microseconds
\item {\ttfamily \char`\"{}arg\char`\"{}}\+: if any {\ttfamily \char`\"{}arg\char`\"{}} argument is passed to the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae2aafddbf5be67012e3b57f846c4105e}{H\+T\+T\+P\+Client\+:\+:set\+Warning\+Queue()}} method, it will be included in the warning hash here 
\end{DoxyItemize}\\
\hline
{\em warning\+\_\+bs} & value in bytes per second; if any call has performance below this threshold, a socket warning is placed on the warning queue with the following keys\+:
\begin{DoxyItemize}
\item {\ttfamily \char`\"{}type\char`\"{}}\+: a string with the constant value {\ttfamily \char`\"{}\+S\+O\+C\+K\+E\+T-\/\+T\+H\+R\+O\+U\+G\+H\+P\+U\+T-\/\+W\+A\+R\+N\+I\+N\+G\char`\"{}} 
\item {\ttfamily \char`\"{}dir\char`\"{}}\+: either {\ttfamily \char`\"{}send\char`\"{}} or {\ttfamily \char`\"{}recv\char`\"{}} depending on the direction of the data flow
\item {\ttfamily \char`\"{}bytes\char`\"{}}\+: the amount of bytes sent
\item {\ttfamily \char`\"{}us\char`\"{}}\+: an integer giving the number of microseconds for the operation
\item {\ttfamily \char`\"{}bytes\+\_\+sec\char`\"{}}\+: a float giving the transfer speed in bytes per second
\item {\ttfamily \char`\"{}threshold\char`\"{}}\+: an integer giving the warning threshold in bytes per second
\item {\ttfamily \char`\"{}arg\char`\"{}}\+: if any {\ttfamily \char`\"{}arg\char`\"{}} argument is passed to the \mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_ae2aafddbf5be67012e3b57f846c4105e}{H\+T\+T\+P\+Client\+:\+:set\+Warning\+Queue()}} method, it will be included in the warning hash here 
\end{DoxyItemize}\\
\hline
{\em queue} & the \mbox{\hyperlink{class_qore_1_1_thread_1_1_queue}{Queue}} object to receive warning events \\
\hline
{\em arg} & an optional argument to be placed in the {\ttfamily \char`\"{}arg\char`\"{}} key in each warning hash (could be used to identify the socket for example) \\
\hline
{\em min\+\_\+ms} & the minimum transfer time with a resolution of milliseconds for a transfer to be eligible for triggering a warning; transfers that take less than this period of time are not eligible for raising a warning\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em Q\+U\+E\+U\+E-\/\+E\+R\+R\+OR} & the Queue passed has a maximum size set \\
\hline
{\em S\+O\+C\+K\+E\+T-\/\+S\+E\+T\+W\+A\+R\+N\+I\+N\+G\+Q\+U\+E\+U\+E-\/\+E\+R\+R\+OR} & at least one of {\itshape warning\+\_\+ms} and {\itshape warning\+\_\+bs} must be $>$ 0\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_h_t_t_p_client_a4102b502a8be8262eecea4e0a85ebe5b}{H\+T\+T\+P\+Client\+::clear\+Warning\+Queue()}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}

\begin{DoxyItemize}
\item Qore 0.\+8.\+9
\item Qore 0.\+8.\+12 the minimum threshold for a warning is a transfer of at least 1024 bytes, smaller transfers will not result in a warning 
\end{DoxyItemize}
\end{DoxySince}
