Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > b3a1f4d91c26f535919e39e25606614a > files > 1389

wt-doc-3.2.3-1.fc18.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Wt: Wt::Http::Client Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Wt
   &#160;<span id="projectnumber">3.2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespaceWt.html">Wt</a>      </li>
      <li class="navelem"><a class="el" href="namespaceWt_1_1Http.html">Http</a>      </li>
      <li class="navelem"><a class="el" href="classWt_1_1Http_1_1Client.html">Client</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">Wt::Http::Client Class Reference<div class="ingroups"><a class="el" href="group__http.html">HTTP protocol (Wt::Http)</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="Wt::Http::Client" --><!-- doxytag: inherits="Wt::WObject" -->
<p>An HTTP client.  
 <a href="classWt_1_1Http_1_1Client.html#details">More...</a></p>

<p><code>#include &lt;Wt/Http/Client&gt;</code></p>
<div class="dynheader">
Inheritance diagram for Wt::Http::Client:</div>
<div class="dyncontent">
<div class="center"><img src="classWt_1_1Http_1_1Client__inherit__graph.png" border="0" usemap="#Wt_1_1Http_1_1Client_inherit__map" alt="Inheritance graph"/></div>
<map name="Wt_1_1Http_1_1Client_inherit__map" id="Wt_1_1Http_1_1Client_inherit__map">
<area shape="rect" href="classWt_1_1WObject.html" title="A base class for objects that participate in the signal/slot system." alt="" coords="13,5,109,32"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="classWt_1_1Http_1_1Client-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structWt_1_1Http_1_1Client_1_1URL.html">URL</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility class representing an URL.  <a href="structWt_1_1Http_1_1Client_1_1URL.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Client.html#ae61882b1de0a4965ca8053139e1fdc5b">Client</a> (<a class="el" href="classWt_1_1WObject.html">WObject</a> *parent=0)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor.  <a href="#ae61882b1de0a4965ca8053139e1fdc5b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Client.html#a6de4a3b49f1e15e4d38ffd7fa3463de1">Client</a> (<a class="el" href="classWt_1_1WIOService.html">WIOService</a> &amp;ioService, <a class="el" href="classWt_1_1WObject.html">WObject</a> *parent=0)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <a href="#a6de4a3b49f1e15e4d38ffd7fa3463de1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Client.html#a7da4dec8f24f8215f87efffbd20657e3">~Client</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor.  <a href="#a7da4dec8f24f8215f87efffbd20657e3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Client.html#a8028fe5ce7d0b005d076c3e69f629b83">setTimeout</a> (int seconds)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets an I/O timeout.  <a href="#a8028fe5ce7d0b005d076c3e69f629b83"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Client.html#a3853ca1ea04a24e94eb02e14370f79f3">timeout</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the I/O timeout.  <a href="#a3853ca1ea04a24e94eb02e14370f79f3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Client.html#a45b25de10c5da7c7c5abf0892593a04d">setMaximumResponseSize</a> (std::size_t bytes)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a maximum response size.  <a href="#a45b25de10c5da7c7c5abf0892593a04d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Client.html#aa0570ee898bc9bd34cbf1b960bd87e44">maximumResponseSize</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the maximum response size.  <a href="#aa0570ee898bc9bd34cbf1b960bd87e44"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Client.html#ac6b8b35ab2813a22c3c2e2ae7d1f9a35">setSslVerifyFile</a> (const std::string &amp;verifyFile)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a SSL certificate used for server identity verification.  <a href="#ac6b8b35ab2813a22c3c2e2ae7d1f9a35"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Client.html#a7c9fbf7fc9f671519b0652f3bbe38521">setSslVerifyPath</a> (const std::string &amp;verifyPath)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a path with SSL certificates for server identity verification.  <a href="#a7c9fbf7fc9f671519b0652f3bbe38521"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Client.html#a1bf5f26230279a99fa1429ab84315458">get</a> (const std::string &amp;url)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Starts a GET request.  <a href="#a1bf5f26230279a99fa1429ab84315458"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Client.html#ab8b9fe9ff278c5a8cb97125ed3671bb3">get</a> (const std::string &amp;url, const std::vector&lt; <a class="el" href="classWt_1_1Http_1_1Message_1_1Header.html">Message::Header</a> &gt; headers)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Starts a GET request.  <a href="#ab8b9fe9ff278c5a8cb97125ed3671bb3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Client.html#a2b5cad895252510ff1cd0e8e6e31c453">post</a> (const std::string &amp;url, const <a class="el" href="classWt_1_1Http_1_1Message.html">Message</a> &amp;message)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Starts a POST request.  <a href="#a2b5cad895252510ff1cd0e8e6e31c453"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Client.html#aed50841f6c792d8f08e44225401abab0">request</a> (<a class="el" href="namespaceWt_1_1Http.html#a4a1e30eb403b05b4e5afc5c6286dd6b9">Http::Method</a> method, const std::string &amp;url, const <a class="el" href="classWt_1_1Http_1_1Message.html">Message</a> &amp;message)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Starts a request.  <a href="#aed50841f6c792d8f08e44225401abab0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Client.html#ac2a756dec030880f02bb3411469c737e">abort</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Aborts the curent request.  <a href="#ac2a756dec030880f02bb3411469c737e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classWt_1_1Signal.html">Signal</a><br class="typebreak"/>
&lt; boost::system::error_code, <br class="typebreak"/>
<a class="el" href="classWt_1_1Http_1_1Message.html">Message</a> &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Client.html#aef3aee01b919b503f9bcb2042819b5fb">done</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Signal that is emitted when the current request is done.  <a href="#aef3aee01b919b503f9bcb2042819b5fb"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Http_1_1Client.html#a7855c34bd3d468a53d1d75446a358724">parseUrl</a> (const std::string &amp;url, <a class="el" href="structWt_1_1Http_1_1Client_1_1URL.html">URL</a> &amp;parsedUrl)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility method to parse a URL.  <a href="#a7855c34bd3d468a53d1d75446a358724"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>An HTTP client. </p>
<p>This class implements an HTTP client. It can be used to interact with web services using the HTTP protocol.</p>
<p>The client uses asynchronous I/O and only provides an asynchronous interface: you cannot actively wait for an operation to complete, instead the client will notify you of the result using the <a class="el" href="classWt_1_1Http_1_1Client.html#aef3aee01b919b503f9bcb2042819b5fb" title="Signal that is emitted when the current request is done.">done()</a> signal.</p>
<p>Because the client uses asynchronous I/O, it does its work within the scope of an event-driven thread pool implementation. By default, this is the same thread pool that is used by the Wt server, available through <a class="el" href="classWt_1_1WServer.html#a8e1945f6fc8013457037bc7280f5cfaa" title="Returns the I/O service.">WServer::ioService()</a>, but you may also use the client by providing it an explicit I/O service to be used.</p>
<p>The client supports the HTTP and HTTPS (if Wt was built with OpenSSL support) protocols, and can be used for GET and POST methods. One client can do only one operation at a time.</p>
<p>Usage example: </p>
<div class="fragment"><pre class="fragment">    ...
    Http::Client *client = <span class="keyword">new</span> <a class="code" href="classWt_1_1Http_1_1Client.html#ae61882b1de0a4965ca8053139e1fdc5b" title="Default constructor.">Http::Client</a>(<span class="keyword">this</span>);
    client-&gt;setTimeout(15);
    client-&gt;setMaximumResponseSize(10 * 1024);
    client-&gt;done().connect(boost::bind(&amp;MyWidget::handleHttpResponse, <span class="keyword">this</span>, _1, _2));
    <span class="keywordflow">if</span> (client-&gt;get(<span class="stringliteral">&quot;http://www.webtoolkit.eu/wt/blog/feed/&quot;</span>))
      <a class="code" href="classWt_1_1WApplication.html#a38d922da0a0d83395519f3eaab85d0f6" title="Returns the current application instance.">WApplication::instance</a>()-&gt;deferRendering();
    } <span class="keywordflow">else</span> {
      <span class="comment">// in case of an error in the %URL</span>
    }
 }

 <span class="keywordtype">void</span> handleHttpResponse(boost::system::error_code err, <span class="keyword">const</span> Http::Message&amp; response)
 {
    <a class="code" href="classWt_1_1WApplication.html#a38d922da0a0d83395519f3eaab85d0f6" title="Returns the current application instance.">WApplication::instance</a>()-&gt;resumeRendering();

    <span class="keywordflow">if</span> (!err &amp;&amp; response.status() == 200) {
       ... <a class="code" href="group__json.html#ga3e87c721522c671af2a426718ee5a4f8" title="Parse function.">parse</a> response.body()
    }
 }
</pre></div><p>The function connected to the <a class="el" href="classWt_1_1Http_1_1Client.html#aef3aee01b919b503f9bcb2042819b5fb" title="Signal that is emitted when the current request is done.">done()</a> signal will be run within the context of the application that created the client. <a class="el" href="classWt_1_1WServer.html#a6115cc9ad6ec28e55fb85e32a045df88" title="Posts a function to a session.">WServer::post()</a> is used for this. </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ae61882b1de0a4965ca8053139e1fdc5b"></a><!-- doxytag: member="Wt::Http::Client::Client" ref="ae61882b1de0a4965ca8053139e1fdc5b" args="(WObject *parent=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Wt::Http::Client::Client </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classWt_1_1WObject.html">WObject</a> *&#160;</td>
          <td class="paramname"><em>parent</em> = <code>0</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Default constructor. </p>
<p>The client uses the I/O service and thread-pool from the current <a class="el" href="classWt_1_1WApplication.html#a38d922da0a0d83395519f3eaab85d0f6" title="Returns the current application instance.">WApplication::instance()</a>. </p>

</div>
</div>
<a class="anchor" id="a6de4a3b49f1e15e4d38ffd7fa3463de1"></a><!-- doxytag: member="Wt::Http::Client::Client" ref="a6de4a3b49f1e15e4d38ffd7fa3463de1" args="(WIOService &amp;ioService, WObject *parent=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Wt::Http::Client::Client </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classWt_1_1WIOService.html">WIOService</a> &amp;&#160;</td>
          <td class="paramname"><em>ioService</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classWt_1_1WObject.html">WObject</a> *&#160;</td>
          <td class="paramname"><em>parent</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Constructor. </p>
<p>The client uses the given I/O service and thread-pool, and is useful to use the client outside the context of a web application. </p>

</div>
</div>
<a class="anchor" id="a7da4dec8f24f8215f87efffbd20657e3"></a><!-- doxytag: member="Wt::Http::Client::~Client" ref="a7da4dec8f24f8215f87efffbd20657e3" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Wt::Http::Client::~Client </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Destructor. </p>
<p>If the client is still busy, the current request is aborted.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Http_1_1Client.html#ac2a756dec030880f02bb3411469c737e" title="Aborts the curent request.">abort()</a> </dd></dl>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ac2a756dec030880f02bb3411469c737e"></a><!-- doxytag: member="Wt::Http::Client::abort" ref="ac2a756dec030880f02bb3411469c737e" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::Http::Client::abort </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Aborts the curent request. </p>
<p>If the client is currently busy, this cancels the pending request. <a class="el" href="classWt_1_1Http_1_1Client.html#aef3aee01b919b503f9bcb2042819b5fb" title="Signal that is emitted when the current request is done.">done()</a> will be emitted with an error_code. (FIXME: which one ?) </p>

</div>
</div>
<a class="anchor" id="aef3aee01b919b503f9bcb2042819b5fb"></a><!-- doxytag: member="Wt::Http::Client::done" ref="aef3aee01b919b503f9bcb2042819b5fb" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1Signal.html">Signal</a>&lt;boost::system::error_code, <a class="el" href="classWt_1_1Http_1_1Message.html">Message</a>&gt;&amp; Wt::Http::Client::done </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Signal that is emitted when the current request is done. </p>
<p>The <code>error</code> is 0 if the HTTP request was successful. Then, the <code>message</code> contains the result.</p>
<p>If the <code>error</code> is not 0, then an error message is given by <code>error.message()</code>.</p>
<p>Typical code to process the result is: </p>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">void</span> handle(boost::system::error_code err, <span class="keyword">const</span> Http::Message&amp; response)
 {
   <span class="keywordflow">if</span> (!err) {
     <span class="keywordflow">if</span> (response.status() == 200) {
       ... success
     }
   } <span class="keywordflow">else</span> {
     Wt::log(<span class="stringliteral">&quot;error&quot;</span>) &lt;&lt; <span class="stringliteral">&quot;Http::Client error: &quot;</span> &lt;&lt; err.message();
   }
 }
</pre></div> 
</div>
</div>
<a class="anchor" id="a1bf5f26230279a99fa1429ab84315458"></a><!-- doxytag: member="Wt::Http::Client::get" ref="a1bf5f26230279a99fa1429ab84315458" args="(const std::string &amp;url)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Wt::Http::Client::get </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>url</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Starts a GET request. </p>
<p>The function starts an asynchronous GET request, and returns immediately.</p>
<p>The function returns <code>true</code> when the GET request has been scheduled, and thus <a class="el" href="classWt_1_1Http_1_1Client.html#aef3aee01b919b503f9bcb2042819b5fb" title="Signal that is emitted when the current request is done.">done()</a> will be emitted eventually.</p>
<p>The function returns <code>false</code> if the client could not schedule the request, for example if the <code>url</code> is invalid or if the URL scheme is not supported.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Http_1_1Client.html#aed50841f6c792d8f08e44225401abab0" title="Starts a request.">request()</a>, <a class="el" href="classWt_1_1Http_1_1Client.html#aef3aee01b919b503f9bcb2042819b5fb" title="Signal that is emitted when the current request is done.">done()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ab8b9fe9ff278c5a8cb97125ed3671bb3"></a><!-- doxytag: member="Wt::Http::Client::get" ref="ab8b9fe9ff278c5a8cb97125ed3671bb3" args="(const std::string &amp;url, const std::vector&lt; Message::Header &gt; headers)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Wt::Http::Client::get </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>url</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; <a class="el" href="classWt_1_1Http_1_1Message_1_1Header.html">Message::Header</a> &gt;&#160;</td>
          <td class="paramname"><em>headers</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Starts a GET request. </p>
<p>The function starts an asynchronous GET request, and returns immediately.</p>
<p>The function returns <code>true</code> when the GET request has been scheduled, and thus <a class="el" href="classWt_1_1Http_1_1Client.html#aef3aee01b919b503f9bcb2042819b5fb" title="Signal that is emitted when the current request is done.">done()</a> will be emitted eventually.</p>
<p>The function returns <code>false</code> if the client could not schedule the request, for example if the <code>url</code> is invalid or if the URL scheme is not supported.</p>
<p>This function accepts one or more headers.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Http_1_1Client.html#aed50841f6c792d8f08e44225401abab0" title="Starts a request.">request()</a>, <a class="el" href="classWt_1_1Http_1_1Client.html#aef3aee01b919b503f9bcb2042819b5fb" title="Signal that is emitted when the current request is done.">done()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="aa0570ee898bc9bd34cbf1b960bd87e44"></a><!-- doxytag: member="Wt::Http::Client::maximumResponseSize" ref="aa0570ee898bc9bd34cbf1b960bd87e44" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::size_t Wt::Http::Client::maximumResponseSize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the maximum response size. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Http_1_1Client.html#a45b25de10c5da7c7c5abf0892593a04d" title="Sets a maximum response size.">setMaximumResponseSize()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a7855c34bd3d468a53d1d75446a358724"></a><!-- doxytag: member="Wt::Http::Client::parseUrl" ref="a7855c34bd3d468a53d1d75446a358724" args="(const std::string &amp;url, URL &amp;parsedUrl)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Wt::Http::Client::parseUrl </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>url</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structWt_1_1Http_1_1Client_1_1URL.html">URL</a> &amp;&#160;</td>
          <td class="paramname"><em>parsedUrl</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Utility method to parse a URL. </p>
<p>This parses a URL into an <a class="el" href="structWt_1_1Http_1_1Client_1_1URL.html" title="Utility class representing an URL.">URL</a> object.</p>
<p>The method returns true if the URL could be parsed successfully. </p>

</div>
</div>
<a class="anchor" id="a2b5cad895252510ff1cd0e8e6e31c453"></a><!-- doxytag: member="Wt::Http::Client::post" ref="a2b5cad895252510ff1cd0e8e6e31c453" args="(const std::string &amp;url, const Message &amp;message)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Wt::Http::Client::post </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>url</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classWt_1_1Http_1_1Message.html">Message</a> &amp;&#160;</td>
          <td class="paramname"><em>message</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Starts a POST request. </p>
<p>The function starts an asynchronous POST request, and returns immediately.</p>
<p>The function returns <code>true</code> when the POST request has been scheduled, and thus <a class="el" href="classWt_1_1Http_1_1Client.html#aef3aee01b919b503f9bcb2042819b5fb" title="Signal that is emitted when the current request is done.">done()</a> will be emitted eventually.</p>
<p>The function returns <code>false</code> if the client could not schedule the request, for example if the <code>url</code> is invalid or if the URL scheme is not supported.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Http_1_1Client.html#aed50841f6c792d8f08e44225401abab0" title="Starts a request.">request()</a>, <a class="el" href="classWt_1_1Http_1_1Client.html#aef3aee01b919b503f9bcb2042819b5fb" title="Signal that is emitted when the current request is done.">done()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="aed50841f6c792d8f08e44225401abab0"></a><!-- doxytag: member="Wt::Http::Client::request" ref="aed50841f6c792d8f08e44225401abab0" args="(Http::Method method, const std::string &amp;url, const Message &amp;message)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Wt::Http::Client::request </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespaceWt_1_1Http.html#a4a1e30eb403b05b4e5afc5c6286dd6b9">Http::Method</a>&#160;</td>
          <td class="paramname"><em>method</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>url</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classWt_1_1Http_1_1Message.html">Message</a> &amp;&#160;</td>
          <td class="paramname"><em>message</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Starts a request. </p>
<p>The function starts an asynchronous HTTP request, and returns immediately.</p>
<p>The function returns <code>true</code> when the request has been scheduled, and thus <a class="el" href="classWt_1_1Http_1_1Client.html#aef3aee01b919b503f9bcb2042819b5fb" title="Signal that is emitted when the current request is done.">done()</a> will be emitted eventually.</p>
<p>The function returns <code>false</code> if the client could not schedule the request, for example if the <code>url</code> is invalid or if the URL scheme is not supported.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Http_1_1Client.html#aed50841f6c792d8f08e44225401abab0" title="Starts a request.">request()</a>, <a class="el" href="classWt_1_1Http_1_1Client.html#aef3aee01b919b503f9bcb2042819b5fb" title="Signal that is emitted when the current request is done.">done()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a45b25de10c5da7c7c5abf0892593a04d"></a><!-- doxytag: member="Wt::Http::Client::setMaximumResponseSize" ref="a45b25de10c5da7c7c5abf0892593a04d" args="(std::size_t bytes)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::Http::Client::setMaximumResponseSize </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>bytes</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets a maximum response size. </p>
<p>The response is stored in-memory. To avoid a DoS by a malicious downstream HTTP server, the response size is bounded by an upper limit.</p>
<p>The limit includes status line, headers and response body.</p>
<p>The default value is 64 kilo bytes. </p>

</div>
</div>
<a class="anchor" id="ac6b8b35ab2813a22c3c2e2ae7d1f9a35"></a><!-- doxytag: member="Wt::Http::Client::setSslVerifyFile" ref="ac6b8b35ab2813a22c3c2e2ae7d1f9a35" args="(const std::string &amp;verifyFile)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::Http::Client::setSslVerifyFile </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>verifyFile</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets a SSL certificate used for server identity verification. </p>
<p>This setting only affects a https request: it configures a certificate file to be used to verify the identity of the server.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Certificate verification does not work reliably yet. </dd></dl>

</div>
</div>
<a class="anchor" id="a7c9fbf7fc9f671519b0652f3bbe38521"></a><!-- doxytag: member="Wt::Http::Client::setSslVerifyPath" ref="a7c9fbf7fc9f671519b0652f3bbe38521" args="(const std::string &amp;verifyPath)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::Http::Client::setSslVerifyPath </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>verifyPath</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets a path with SSL certificates for server identity verification. </p>
<p>This setting only affects a https request: it configures a directory containing certificates to be used to verify the identity of the server.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Certificate verification does not work reliably yet. </dd></dl>

</div>
</div>
<a class="anchor" id="a8028fe5ce7d0b005d076c3e69f629b83"></a><!-- doxytag: member="Wt::Http::Client::setTimeout" ref="a8028fe5ce7d0b005d076c3e69f629b83" args="(int seconds)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::Http::Client::setTimeout </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>seconds</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets an I/O timeout. </p>
<p>This sets a timeout wiating for I/O operations. The timeout does not bound the total timeout, since the timer is reset on each I/O progress.</p>
<p>The default timeout is 10 seconds. </p>

</div>
</div>
<a class="anchor" id="a3853ca1ea04a24e94eb02e14370f79f3"></a><!-- doxytag: member="Wt::Http::Client::timeout" ref="a3853ca1ea04a24e94eb02e14370f79f3" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Wt::Http::Client::timeout </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the I/O timeout. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Http_1_1Client.html#a8028fe5ce7d0b005d076c3e69f629b83" title="Sets an I/O timeout.">setTimeout()</a> </dd></dl>

</div>
</div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr size="1"><address style="text-align: right; margin: 3px"><small>
Generated on Thu Nov 1 2012 for <a href="http://www.webtoolkit.eu/wt">the
C++ Web Toolkit (Wt)</a> by&nbsp;<a
href="http://www.doxygen.org/index.html"><img src="doxygen.png"
alt="doxygen" border="0" style="vertical-align: middle; display:
inline-block; height: 2em"></a> 1.7.5.1</small></address>
</body>
</html>