1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
|
<!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>
<title>Class Poco::Net::HTMLForm</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="language" content="en"/>
<meta name="date" content="2009-11-24"/>
<meta name="generator" content="PocoDoc"/>
<link rel="stylesheet" href="css/styles.css" type="text/css"/>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<div class="header">
<h1 class="namespace"><a href="Poco.Net.html" class="namespace">Poco::Net</a></h1>
<h1 class="symbol">class HTMLForm</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Net<br />
<b>Package:</b> HTML<br />
<b>Header:</b> Poco/Net/HTMLForm.h</p>
<h2>Description</h2>
<div class="description">
<p><a href="Poco.Net.HTMLForm.html" title="class Poco::Net::HTMLForm">HTMLForm</a> is a helper class for working with HTML forms, both on the client and on the server side. </p>
</div>
<h2>Inheritance</h2>
<p><b>Direct Base Classes: </b><a href="Poco.Net.NameValueCollection.html" title="class Poco::Net::NameValueCollection">NameValueCollection</a></p>
<p><b>All Base Classes: </b><a href="Poco.Net.NameValueCollection.html" title="class Poco::Net::NameValueCollection">NameValueCollection</a></p>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.Net.HTMLForm.html#12429" title="Poco::Net::HTMLForm::addPart()">addPart</a>, <a href="Poco.Net.HTMLForm.html#12451" title="Poco::Net::HTMLForm::boundary()">boundary</a>, <a href="Poco.Net.HTMLForm.html#12428" title="Poco::Net::HTMLForm::getEncoding()">getEncoding</a>, <a href="Poco.Net.HTMLForm.html#12432" title="Poco::Net::HTMLForm::load()">load</a>, <a href="Poco.Net.HTMLForm.html#12444" title="Poco::Net::HTMLForm::prepareSubmit()">prepareSubmit</a>, <a href="Poco.Net.HTMLForm.html#12441" title="Poco::Net::HTMLForm::read()">read</a>, <a href="Poco.Net.HTMLForm.html#12456" title="Poco::Net::HTMLForm::readMultipart()">readMultipart</a>, <a href="Poco.Net.HTMLForm.html#12454" title="Poco::Net::HTMLForm::readUrl()">readUrl</a>, <a href="Poco.Net.HTMLForm.html#12426" title="Poco::Net::HTMLForm::setEncoding()">setEncoding</a>, <a href="Poco.Net.HTMLForm.html#12446" title="Poco::Net::HTMLForm::write()">write</a>, <a href="Poco.Net.HTMLForm.html#12461" title="Poco::Net::HTMLForm::writeMultipart()">writeMultipart</a>, <a href="Poco.Net.HTMLForm.html#12459" title="Poco::Net::HTMLForm::writeUrl()">writeUrl</a></p>
<p><b>Inherited Functions: </b><a href="Poco.Net.NameValueCollection.html#14067" title="Poco::Net::NameValueCollection::add()">add</a>, <a href="Poco.Net.NameValueCollection.html#14079" title="Poco::Net::NameValueCollection::begin()">begin</a>, <a href="Poco.Net.NameValueCollection.html#14085" title="Poco::Net::NameValueCollection::clear()">clear</a>, <a href="Poco.Net.NameValueCollection.html#14081" title="Poco::Net::NameValueCollection::empty()">empty</a>, <a href="Poco.Net.NameValueCollection.html#14080" title="Poco::Net::NameValueCollection::end()">end</a>, <a href="Poco.Net.NameValueCollection.html#14083" title="Poco::Net::NameValueCollection::erase()">erase</a>, <a href="Poco.Net.NameValueCollection.html#14077" title="Poco::Net::NameValueCollection::find()">find</a>, <a href="Poco.Net.NameValueCollection.html#14070" title="Poco::Net::NameValueCollection::get()">get</a>, <a href="Poco.Net.NameValueCollection.html#14075" title="Poco::Net::NameValueCollection::has()">has</a>, <a href="Poco.Net.NameValueCollection.html#14062" title="Poco::Net::NameValueCollection::operator()">operator</a>, <a href="Poco.Net.NameValueCollection.html#14058" title="Poco::Net::NameValueCollection::operator =()">operator =</a>, <a href="Poco.Net.NameValueCollection.html#14064" title="Poco::Net::NameValueCollection::set()">set</a>, <a href="Poco.Net.NameValueCollection.html#14082" title="Poco::Net::NameValueCollection::size()">size</a>, <a href="Poco.Net.NameValueCollection.html#14060" title="Poco::Net::NameValueCollection::swap()">swap</a></p>
<h2>Constructors</h2>
<h3><a name="12413">HTMLForm</a></h3>
<p class="decl"><a href="Poco.Net.HTMLForm.html" title="class Poco::Net::HTMLForm">HTMLForm</a>();</p>
<div class="description">
<p>Creates an empty <a href="Poco.Net.HTMLForm.html" title="class Poco::Net::HTMLForm">HTMLForm</a> and sets the encoding to "application/x-www-form-urlencoded". </p>
</div>
<h3><a name="12414">HTMLForm</a></h3>
<p class="decl">explicit <a href="Poco.Net.HTMLForm.html" title="class Poco::Net::HTMLForm">HTMLForm</a>(<br /> const std::string & encoding<br />);</p>
<div class="description">
<p>Creates an empty <a href="Poco.Net.HTMLForm.html" title="class Poco::Net::HTMLForm">HTMLForm</a> that uses the given encoding. </p>
<p>Encoding must be either "application/x-www-form-urlencoded" (which is the default) or "multipart/form-data". </p>
</div>
<h3><a name="12423">HTMLForm</a></h3>
<p class="decl">explicit <a href="Poco.Net.HTMLForm.html" title="class Poco::Net::HTMLForm">HTMLForm</a>(<br /> const <a href="Poco.Net.HTTPRequest.html" title="class Poco::Net::HTTPRequest">HTTPRequest</a> & request<br />);</p>
<div class="description">
<p>Creates a <a href="Poco.Net.HTMLForm.html" title="class Poco::Net::HTMLForm">HTMLForm</a> from the given HTTP request. </p>
<p>The request must be a GET request and the form data must be in the query string (URL encoded). </p>
<p>For POST requests, you must use one of the constructors taking an additional input stream for the request body. </p>
</div>
<h3><a name="12420">HTMLForm</a></h3>
<p class="decl"><a href="Poco.Net.HTMLForm.html" title="class Poco::Net::HTMLForm">HTMLForm</a>(<br /> const <a href="Poco.Net.HTTPRequest.html" title="class Poco::Net::HTTPRequest">HTTPRequest</a> & request,<br /> std::istream & requestBody<br />);</p>
<div class="description">
<p>Creates a <a href="Poco.Net.HTMLForm.html" title="class Poco::Net::HTMLForm">HTMLForm</a> from the given HTTP request. </p>
<p>Uploaded files are silently discarded. </p>
</div>
<h3><a name="12416">HTMLForm</a></h3>
<p class="decl"><a href="Poco.Net.HTMLForm.html" title="class Poco::Net::HTMLForm">HTMLForm</a>(<br /> const <a href="Poco.Net.HTTPRequest.html" title="class Poco::Net::HTTPRequest">HTTPRequest</a> & request,<br /> std::istream & requestBody,<br /> <a href="Poco.Net.PartHandler.html" title="class Poco::Net::PartHandler">PartHandler</a> & handler<br />);</p>
<div class="description">
<p>Creates a <a href="Poco.Net.HTMLForm.html" title="class Poco::Net::HTMLForm">HTMLForm</a> from the given HTTP request. </p>
<p>Uploaded files are passed to the given <a href="Poco.Net.PartHandler.html" title="class Poco::Net::PartHandler">PartHandler</a>. </p>
</div>
<h2>Destructor</h2>
<h3><a name="12425">~HTMLForm</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">~<a href="Poco.Net.HTMLForm.html" title="class Poco::Net::HTMLForm">HTMLForm</a>();</p>
<div class="description">
<p>Destroys the <a href="Poco.Net.HTMLForm.html" title="class Poco::Net::HTMLForm">HTMLForm</a>. </p>
</div>
<h2>Member Functions</h2>
<h3><a name="12429">addPart</a></h3>
<p class="decl">void addPart(<br /> const std::string & name,<br /> <a href="Poco.Net.PartSource.html" title="class Poco::Net::PartSource">PartSource</a> * pSource<br />);</p>
<div class="description">
<p>Adds an part/attachment (file upload) to the form. </p>
<p>The form takes ownership of the <a href="Poco.Net.PartSource.html" title="class Poco::Net::PartSource">PartSource</a> and deletes it when it is no longer needed. </p>
<p>The part will only be sent if the encoding set for the form is "multipart/form-data" </p>
</div>
<h3><a name="12451">boundary</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const std::string & boundary() const;</p>
<div class="description">
<p>Returns the MIME boundary used for writing multipart form data. </p>
</div>
<h3><a name="12428">getEncoding</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const std::string & getEncoding() const;</p>
<div class="description">
<p>Returns the encoding used for posting the form. </p>
</div>
<h3><a name="12432">load</a></h3>
<p class="decl">void load(<br /> const <a href="Poco.Net.HTTPRequest.html" title="class Poco::Net::HTTPRequest">HTTPRequest</a> & request,<br /> std::istream & requestBody,<br /> <a href="Poco.Net.PartHandler.html" title="class Poco::Net::PartHandler">PartHandler</a> & handler<br />);</p>
<div class="description">
<p>Reads the form data from the given HTTP request. </p>
<p>Uploaded files are passed to the given <a href="Poco.Net.PartHandler.html" title="class Poco::Net::PartHandler">PartHandler</a>. </p>
</div>
<h3><a name="12436">load</a></h3>
<p class="decl">void load(<br /> const <a href="Poco.Net.HTTPRequest.html" title="class Poco::Net::HTTPRequest">HTTPRequest</a> & request,<br /> std::istream & requestBody<br />);</p>
<div class="description">
<p>Reads the form data from the given HTTP request. </p>
<p>Uploaded files are silently discarded. </p>
</div>
<h3><a name="12439">load</a></h3>
<p class="decl">void load(<br /> const <a href="Poco.Net.HTTPRequest.html" title="class Poco::Net::HTTPRequest">HTTPRequest</a> & request<br />);</p>
<div class="description">
<p>Reads the form data from the given HTTP request. </p>
<p>The request must be a GET request and the form data must be in the query string (URL encoded). </p>
<p>For POST requests, you must use one of the overloads taking an additional input stream for the request body. </p>
</div>
<h3><a name="12444">prepareSubmit</a></h3>
<p class="decl">void prepareSubmit(<br /> <a href="Poco.Net.HTTPRequest.html" title="class Poco::Net::HTTPRequest">HTTPRequest</a> & request<br />);</p>
<div class="description">
<p>Fills out the request object for submitting the form. </p>
<p>If the request method is GET, the encoded form is appended to the request <a href="Poco.URI.html" title="class Poco::URI">URI</a> as query string. Otherwise (the method is POST), the form's content type is set to the form's encoding. The form's parameters must be written to the request body separately, with a call to write. If the request's HTTP version is HTTP/1.0: </p>
<ul>
<li>persistent connections are disabled </li>
<li>the content transfer encoding is set to identity encoding </li>
</ul>
<p>Otherwise, if the request's HTTP version is HTTP/1.1: </p>
<ul>
<li>the request's persistent connection state is left unchanged </li>
<li>the content transfer encoding is set to chunked </li>
</ul>
</div>
<h3><a name="12441">read</a></h3>
<p class="decl">void read(<br /> std::istream & istr,<br /> <a href="Poco.Net.PartHandler.html" title="class Poco::Net::PartHandler">PartHandler</a> & handler<br />);</p>
<div class="description">
<p>Reads the form data from the given input stream. </p>
<p>The form data read from the stream must be in the encoding specified for the form. </p>
</div>
<h3><a name="12426">setEncoding</a></h3>
<p class="decl">void setEncoding(<br /> const std::string & encoding<br />);</p>
<div class="description">
<p>Sets the encoding used for posting the form. </p>
<p>Encoding must be either "application/x-www-form-urlencoded" (which is the default) or "multipart/form-data". </p>
</div>
<h3><a name="12446">write</a></h3>
<p class="decl">void write(<br /> std::ostream & ostr,<br /> const std::string & boundary<br />);</p>
<div class="description">
<p>Writes the form data to the given output stream, using the specified encoding. </p>
</div>
<h3><a name="12449">write</a></h3>
<p class="decl">void write(<br /> std::ostream & ostr<br />);</p>
<div class="description">
<p>Writes the form data to the given output stream, using the specified encoding. </p>
</div>
<h3><a name="12456">readMultipart</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void readMultipart(<br /> std::istream & istr,<br /> <a href="Poco.Net.PartHandler.html" title="class Poco::Net::PartHandler">PartHandler</a> & handler<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="12454">readUrl</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void readUrl(<br /> std::istream & istr<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="12461">writeMultipart</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void writeMultipart(<br /> std::ostream & ostr<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="12459">writeUrl</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void writeUrl(<br /> std::ostream & ostr<br />);</p>
<div class="description">
<p></p>
</div>
<h2>Variables</h2>
<h3><a name="12453">ENCODING_MULTIPART</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static const std::string <a href="Poco.Net.HTMLForm.html#12453" title="Poco::Net::HTMLForm::ENCODING_MULTIPART">ENCODING_MULTIPART</a>;</p>
<div class="description">
<p>"multipart/form-data" </p>
</div>
<h3><a name="12452">ENCODING_URL</a> <img src="images/static.gif" alt="static" title="static" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">static const std::string <a href="Poco.Net.HTMLForm.html#12452" title="Poco::Net::HTMLForm::ENCODING_URL">ENCODING_URL</a>;</p>
<div class="description">
<p>"application/x-www-form-urlencoded" </p>
</div>
<p class="footer">POCO C++ Libraries 1.3.6-all<br />
Copyright © 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>
</div>
</body>
</html>
|