blob: a943dd2c30ef28064e0c4f7f769fe7b328f07e73 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Crashpad: crashpad::HTTPMultipartBuilder Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="crashpad_doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Crashpad
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</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>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacecrashpad.html">crashpad</a></li><li class="navelem"><a class="el" href="classcrashpad_1_1HTTPMultipartBuilder.html">HTTPMultipartBuilder</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classcrashpad_1_1HTTPMultipartBuilder-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">crashpad::HTTPMultipartBuilder Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>This class is used to build a MIME multipart message, conforming to RFC 2046, for use as a HTTP request body.
<a href="classcrashpad_1_1HTTPMultipartBuilder.html#details">More...</a></p>
<p><code>#include &quot;util/net/http_multipart_builder.h&quot;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a773ca9efe15389e2036e01de59d431e3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1HTTPMultipartBuilder.html#a773ca9efe15389e2036e01de59d431e3">SetGzipEnabled</a> (bool gzip_enabled)</td></tr>
<tr class="memdesc:a773ca9efe15389e2036e01de59d431e3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables or disables <code>gzip</code> compression. <a href="classcrashpad_1_1HTTPMultipartBuilder.html#a773ca9efe15389e2036e01de59d431e3">More...</a><br /></td></tr>
<tr class="separator:a773ca9efe15389e2036e01de59d431e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c51d6649d19f1e5d39b787f18dc2d06"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1HTTPMultipartBuilder.html#a3c51d6649d19f1e5d39b787f18dc2d06">SetFormData</a> (const std::string &amp;key, const std::string &amp;value)</td></tr>
<tr class="memdesc:a3c51d6649d19f1e5d39b787f18dc2d06"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a <code>Content-Disposition: form-data</code> key-value pair. <a href="classcrashpad_1_1HTTPMultipartBuilder.html#a3c51d6649d19f1e5d39b787f18dc2d06">More...</a><br /></td></tr>
<tr class="separator:a3c51d6649d19f1e5d39b787f18dc2d06"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abe2b5055dda416ecc264058e47606f5f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1HTTPMultipartBuilder.html#abe2b5055dda416ecc264058e47606f5f">SetFileAttachment</a> (const std::string &amp;key, const std::string &amp;upload_file_name, <a class="el" href="classcrashpad_1_1FileReaderInterface.html">FileReaderInterface</a> *reader, const std::string &amp;content_type)</td></tr>
<tr class="memdesc:abe2b5055dda416ecc264058e47606f5f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Specifies the contents read from <em>reader</em> to be uploaded as multipart data, available at <code>name</code> of <em>upload_file_name</em>. <a href="classcrashpad_1_1HTTPMultipartBuilder.html#abe2b5055dda416ecc264058e47606f5f">More...</a><br /></td></tr>
<tr class="separator:abe2b5055dda416ecc264058e47606f5f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a071e0642997cb00acdc966371c2d1100"><td class="memItemLeft" align="right" valign="top">std::unique_ptr&lt; <a class="el" href="classcrashpad_1_1HTTPBodyStream.html">HTTPBodyStream</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1HTTPMultipartBuilder.html#a071e0642997cb00acdc966371c2d1100">GetBodyStream</a> ()</td></tr>
<tr class="memdesc:a071e0642997cb00acdc966371c2d1100"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generates the <a class="el" href="classcrashpad_1_1HTTPBodyStream.html" title="An interface to a stream that can be used for an HTTP request body.">HTTPBodyStream</a> for the data currently supplied to the builder. <a href="classcrashpad_1_1HTTPMultipartBuilder.html#a071e0642997cb00acdc966371c2d1100">More...</a><br /></td></tr>
<tr class="separator:a071e0642997cb00acdc966371c2d1100"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a39fb264aa71cb52ecb3cc22f9b000106"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1HTTPMultipartBuilder.html#a39fb264aa71cb52ecb3cc22f9b000106">PopulateContentHeaders</a> (<a class="el" href="namespacecrashpad.html#af6ffe10a8131fab8d1f8de60d9a812f9">HTTPHeaders</a> *http_headers) const</td></tr>
<tr class="memdesc:a39fb264aa71cb52ecb3cc22f9b000106"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds the appropriate content headers to <em>http_headers</em>. <a href="classcrashpad_1_1HTTPMultipartBuilder.html#a39fb264aa71cb52ecb3cc22f9b000106">More...</a><br /></td></tr>
<tr class="separator:a39fb264aa71cb52ecb3cc22f9b000106"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This class is used to build a MIME multipart message, conforming to RFC 2046, for use as a HTTP request body. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a071e0642997cb00acdc966371c2d1100"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a071e0642997cb00acdc966371c2d1100">&#9670;&nbsp;</a></span>GetBodyStream()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::unique_ptr&lt; <a class="el" href="classcrashpad_1_1HTTPBodyStream.html">HTTPBodyStream</a> &gt; crashpad::HTTPMultipartBuilder::GetBodyStream </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Generates the <a class="el" href="classcrashpad_1_1HTTPBodyStream.html" title="An interface to a stream that can be used for an HTTP request body.">HTTPBodyStream</a> for the data currently supplied to the builder. </p>
<dl class="section return"><dt>Returns</dt><dd>A caller-owned <a class="el" href="classcrashpad_1_1HTTPBodyStream.html" title="An interface to a stream that can be used for an HTTP request body.">HTTPBodyStream</a> object. </dd></dl>
</div>
</div>
<a id="a39fb264aa71cb52ecb3cc22f9b000106"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a39fb264aa71cb52ecb3cc22f9b000106">&#9670;&nbsp;</a></span>PopulateContentHeaders()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void crashpad::HTTPMultipartBuilder::PopulateContentHeaders </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespacecrashpad.html#af6ffe10a8131fab8d1f8de60d9a812f9">HTTPHeaders</a> *&#160;</td>
<td class="paramname"><em>http_headers</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds the appropriate content headers to <em>http_headers</em>. </p>
<p>Any headers that this method adds will replace existing headers by the same name in <em>http_headers</em>. </p>
</div>
</div>
<a id="abe2b5055dda416ecc264058e47606f5f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abe2b5055dda416ecc264058e47606f5f">&#9670;&nbsp;</a></span>SetFileAttachment()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void crashpad::HTTPMultipartBuilder::SetFileAttachment </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>key</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>upload_file_name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classcrashpad_1_1FileReaderInterface.html">FileReaderInterface</a> *&#160;</td>
<td class="paramname"><em>reader</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>content_type</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Specifies the contents read from <em>reader</em> to be uploaded as multipart data, available at <code>name</code> of <em>upload_file_name</em>. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">key</td><td>The key of the form data, specified as the <code>name</code> in the multipart message. Any data previously set on this class with this key will be overwritten. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">upload_file_name</td><td>The <code>filename</code> to specify for this multipart data attachment. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">reader</td><td>A <a class="el" href="classcrashpad_1_1FileReaderInterface.html" title="An interface to read to files and other file-like objects with semantics matching the underlying plat...">FileReaderInterface</a> from which to read the content to upload. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">content_type</td><td>The <code>Content-Type</code> to specify for the attachment. If this is empty, <code>"application/octet-stream"</code> will be used. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a3c51d6649d19f1e5d39b787f18dc2d06"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3c51d6649d19f1e5d39b787f18dc2d06">&#9670;&nbsp;</a></span>SetFormData()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void crashpad::HTTPMultipartBuilder::SetFormData </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>key</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets a <code>Content-Disposition: form-data</code> key-value pair. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">key</td><td>The key of the form data, specified as the <code>name</code> in the multipart message. Any data previously set on this class with this key will be overwritten. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The value to set at the <em>key</em>. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a773ca9efe15389e2036e01de59d431e3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a773ca9efe15389e2036e01de59d431e3">&#9670;&nbsp;</a></span>SetGzipEnabled()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void crashpad::HTTPMultipartBuilder::SetGzipEnabled </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>gzip_enabled</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Enables or disables <code>gzip</code> compression. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">gzip_enabled</td><td>Whether to enable or disable <code>gzip</code> compression.</td></tr>
</table>
</dd>
</dl>
<p>When <code>gzip</code> compression is enabled, the body stream returned by <a class="el" href="classcrashpad_1_1HTTPMultipartBuilder.html#a071e0642997cb00acdc966371c2d1100" title="Generates the HTTPBodyStream for the data currently supplied to the builder.">GetBodyStream()</a> will be <code>gzip</code>-compressed, and the content headers set by <a class="el" href="classcrashpad_1_1HTTPMultipartBuilder.html#a39fb264aa71cb52ecb3cc22f9b000106" title="Adds the appropriate content headers to http_headers.">PopulateContentHeaders()</a> will contain <code>Content-Encoding: gzip</code>. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>util/net/http_multipart_builder.h</li>
<li>util/net/http_multipart_builder.cc</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
</html>