mastodonpp/docs/classmastodonpp_1_1Connection.html
2020-01-10 19:10:54 +01:00

522 lines
49 KiB
HTML

<!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.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>mastodonpp: mastodonpp::Connection 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" />
</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">mastodonpp
&#160;<span id="projectnumber">0.1.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.16 -->
<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="namespacemastodonpp.html">mastodonpp</a></li><li class="navelem"><a class="el" href="classmastodonpp_1_1Connection.html">Connection</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classmastodonpp_1_1Connection-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">mastodonpp::Connection Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Represents a connection to an instance. Used for requests.
<a href="classmastodonpp_1_1Connection.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="connection_8hpp_source.html">mastodonpp/connection.hpp</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for mastodonpp::Connection:</div>
<div class="dyncontent">
<div class="center">
<img src="classmastodonpp_1_1Connection.png" usemap="#mastodonpp::Connection_map" alt=""/>
<map id="mastodonpp::Connection_map" name="mastodonpp::Connection_map">
<area href="classmastodonpp_1_1CURLWrapper.html" title="Handles the details of network connections." alt="mastodonpp::CURLWrapper" shape="rect" coords="0,0,166,24"/>
</map>
</div></div>
<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:ac5fedffbd59686c26b1e44a7a96c216a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1Connection.html#ac5fedffbd59686c26b1e44a7a96c216a">Connection</a> (<a class="el" href="classmastodonpp_1_1Instance.html">Instance</a> &amp;instance)</td></tr>
<tr class="memdesc:ac5fedffbd59686c26b1e44a7a96c216a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct a new <a class="el" href="classmastodonpp_1_1Connection.html" title="Represents a connection to an instance. Used for requests.">Connection</a> object. <a href="classmastodonpp_1_1Connection.html#ac5fedffbd59686c26b1e44a7a96c216a">More...</a><br /></td></tr>
<tr class="separator:ac5fedffbd59686c26b1e44a7a96c216a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade24a99769313ee15c406d97e9543cba"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structmastodonpp_1_1answer__type.html">answer_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1Connection.html#ade24a99769313ee15c406d97e9543cba">get</a> (const <a class="el" href="namespacemastodonpp.html#ad228a850ba86374f95d9fa1fece3c33b">endpoint_variant</a> &amp;endpoint, const <a class="el" href="namespacemastodonpp.html#af8b3b89118adeccc71c54dfd36c987f6">parametermap</a> &amp;parameters)</td></tr>
<tr class="memdesc:ade24a99769313ee15c406d97e9543cba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Make a HTTP GET call with parameters. <a href="classmastodonpp_1_1Connection.html#ade24a99769313ee15c406d97e9543cba">More...</a><br /></td></tr>
<tr class="separator:ade24a99769313ee15c406d97e9543cba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a60034eabe75bd3afade110a171c66d05"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structmastodonpp_1_1answer__type.html">answer_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1Connection.html#a60034eabe75bd3afade110a171c66d05">get</a> (const <a class="el" href="namespacemastodonpp.html#ad228a850ba86374f95d9fa1fece3c33b">endpoint_variant</a> &amp;endpoint)</td></tr>
<tr class="memdesc:a60034eabe75bd3afade110a171c66d05"><td class="mdescLeft">&#160;</td><td class="mdescRight">Make a HTTP GET call. <a href="classmastodonpp_1_1Connection.html#a60034eabe75bd3afade110a171c66d05">More...</a><br /></td></tr>
<tr class="separator:a60034eabe75bd3afade110a171c66d05"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad7cebeeef7c285ff4666dc6850f20164"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structmastodonpp_1_1answer__type.html">answer_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1Connection.html#ad7cebeeef7c285ff4666dc6850f20164">post</a> (const <a class="el" href="namespacemastodonpp.html#ad228a850ba86374f95d9fa1fece3c33b">endpoint_variant</a> &amp;endpoint, const <a class="el" href="namespacemastodonpp.html#af8b3b89118adeccc71c54dfd36c987f6">parametermap</a> &amp;parameters)</td></tr>
<tr class="memdesc:ad7cebeeef7c285ff4666dc6850f20164"><td class="mdescLeft">&#160;</td><td class="mdescRight">Make a HTTP POST call with parameters. <a href="classmastodonpp_1_1Connection.html#ad7cebeeef7c285ff4666dc6850f20164">More...</a><br /></td></tr>
<tr class="separator:ad7cebeeef7c285ff4666dc6850f20164"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af27eb5d94f5a0e39a703988fdcc54173"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structmastodonpp_1_1answer__type.html">answer_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1Connection.html#af27eb5d94f5a0e39a703988fdcc54173">post</a> (const <a class="el" href="namespacemastodonpp.html#ad228a850ba86374f95d9fa1fece3c33b">endpoint_variant</a> &amp;endpoint)</td></tr>
<tr class="memdesc:af27eb5d94f5a0e39a703988fdcc54173"><td class="mdescLeft">&#160;</td><td class="mdescRight">Make a HTTP POST call. <a href="classmastodonpp_1_1Connection.html#af27eb5d94f5a0e39a703988fdcc54173">More...</a><br /></td></tr>
<tr class="separator:af27eb5d94f5a0e39a703988fdcc54173"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a06f537c75c7fe9a7510e11af1008e028"><td class="memItemLeft" align="right" valign="top">string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1Connection.html#a06f537c75c7fe9a7510e11af1008e028">get_new_stream_contents</a> ()</td></tr>
<tr class="memdesc:a06f537c75c7fe9a7510e11af1008e028"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy new stream contents and delete the “original”. <a href="classmastodonpp_1_1Connection.html#a06f537c75c7fe9a7510e11af1008e028">More...</a><br /></td></tr>
<tr class="separator:a06f537c75c7fe9a7510e11af1008e028"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e4a50fb73aa50b027d9a0822cfde318"><td class="memItemLeft" align="right" valign="top">vector&lt; <a class="el" href="structmastodonpp_1_1event__type.html">event_type</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1Connection.html#a7e4a50fb73aa50b027d9a0822cfde318">get_new_events</a> ()</td></tr>
<tr class="memdesc:a7e4a50fb73aa50b027d9a0822cfde318"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get new stream events. <a href="classmastodonpp_1_1Connection.html#a7e4a50fb73aa50b027d9a0822cfde318">More...</a><br /></td></tr>
<tr class="separator:a7e4a50fb73aa50b027d9a0822cfde318"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8cf6ab350bb359650925d1c582fe9f60"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1Connection.html#a8cf6ab350bb359650925d1c582fe9f60">cancel_stream</a> ()</td></tr>
<tr class="memdesc:a8cf6ab350bb359650925d1c582fe9f60"><td class="mdescLeft">&#160;</td><td class="mdescRight">Cancel the stream. <a href="classmastodonpp_1_1Connection.html#a8cf6ab350bb359650925d1c582fe9f60">More...</a><br /></td></tr>
<tr class="separator:a8cf6ab350bb359650925d1c582fe9f60"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classmastodonpp_1_1CURLWrapper"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classmastodonpp_1_1CURLWrapper')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classmastodonpp_1_1CURLWrapper.html">mastodonpp::CURLWrapper</a></td></tr>
<tr class="memitem:a736572303fbec7a307514e611e6a468c inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a736572303fbec7a307514e611e6a468c">CURLWrapper</a> ()</td></tr>
<tr class="memdesc:a736572303fbec7a307514e611e6a468c inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes curl and sets up connection. <a href="classmastodonpp_1_1CURLWrapper.html#a736572303fbec7a307514e611e6a468c">More...</a><br /></td></tr>
<tr class="separator:a736572303fbec7a307514e611e6a468c inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a108929a9985c76a8e2cd1f531ac6d321 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a108929a9985c76a8e2cd1f531ac6d321">CURLWrapper</a> (const <a class="el" href="classmastodonpp_1_1CURLWrapper.html">CURLWrapper</a> &amp;other)=delete</td></tr>
<tr class="memdesc:a108929a9985c76a8e2cd1f531ac6d321 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy constructor. <a href="classmastodonpp_1_1CURLWrapper.html#a108929a9985c76a8e2cd1f531ac6d321">More...</a><br /></td></tr>
<tr class="separator:a108929a9985c76a8e2cd1f531ac6d321 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d79b9a4525ac4b4b8954ccc794af0f9 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a4d79b9a4525ac4b4b8954ccc794af0f9">CURLWrapper</a> (<a class="el" href="classmastodonpp_1_1CURLWrapper.html">CURLWrapper</a> &amp;&amp;other) noexcept=delete</td></tr>
<tr class="memdesc:a4d79b9a4525ac4b4b8954ccc794af0f9 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move constructor. <a href="classmastodonpp_1_1CURLWrapper.html#a4d79b9a4525ac4b4b8954ccc794af0f9">More...</a><br /></td></tr>
<tr class="separator:a4d79b9a4525ac4b4b8954ccc794af0f9 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a350f7061c9cb54cb5992ae983db3fc19 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a350f7061c9cb54cb5992ae983db3fc19">~CURLWrapper</a> () noexcept</td></tr>
<tr class="memdesc:a350f7061c9cb54cb5992ae983db3fc19 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft">&#160;</td><td class="mdescRight">Cleans up curl and connection. <a href="classmastodonpp_1_1CURLWrapper.html#a350f7061c9cb54cb5992ae983db3fc19">More...</a><br /></td></tr>
<tr class="separator:a350f7061c9cb54cb5992ae983db3fc19 inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5f29b7f4d0b58f70bc96f362cdaa4d0a inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmastodonpp_1_1CURLWrapper.html">CURLWrapper</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a5f29b7f4d0b58f70bc96f362cdaa4d0a">operator=</a> (const <a class="el" href="classmastodonpp_1_1CURLWrapper.html">CURLWrapper</a> &amp;other)=delete</td></tr>
<tr class="memdesc:a5f29b7f4d0b58f70bc96f362cdaa4d0a inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy assignment operator. <a href="classmastodonpp_1_1CURLWrapper.html#a5f29b7f4d0b58f70bc96f362cdaa4d0a">More...</a><br /></td></tr>
<tr class="separator:a5f29b7f4d0b58f70bc96f362cdaa4d0a inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a506cb49c00a63ef4b9d51d0d52c203dc inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmastodonpp_1_1CURLWrapper.html">CURLWrapper</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a506cb49c00a63ef4b9d51d0d52c203dc">operator=</a> (<a class="el" href="classmastodonpp_1_1CURLWrapper.html">CURLWrapper</a> &amp;&amp;other) noexcept=delete</td></tr>
<tr class="memdesc:a506cb49c00a63ef4b9d51d0d52c203dc inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move assignment operator. <a href="classmastodonpp_1_1CURLWrapper.html#a506cb49c00a63ef4b9d51d0d52c203dc">More...</a><br /></td></tr>
<tr class="separator:a506cb49c00a63ef4b9d51d0d52c203dc inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2b7aaf03245a0730eeb464802168aded inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">CURL *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a2b7aaf03245a0730eeb464802168aded">get_curl_easy_handle</a> ()</td></tr>
<tr class="memdesc:a2b7aaf03245a0730eeb464802168aded inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns pointer to the CURL easy handle. <a href="classmastodonpp_1_1CURLWrapper.html#a2b7aaf03245a0730eeb464802168aded">More...</a><br /></td></tr>
<tr class="separator:a2b7aaf03245a0730eeb464802168aded inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1564a42794ef7a9d170b725063ef504d inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a1564a42794ef7a9d170b725063ef504d">set_proxy</a> (string_view proxy)</td></tr>
<tr class="memdesc:a1564a42794ef7a9d170b725063ef504d inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the proxy to use. <a href="classmastodonpp_1_1CURLWrapper.html#a1564a42794ef7a9d170b725063ef504d">More...</a><br /></td></tr>
<tr class="separator:a1564a42794ef7a9d170b725063ef504d inherit pub_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pro_methods_classmastodonpp_1_1CURLWrapper"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_classmastodonpp_1_1CURLWrapper')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="classmastodonpp_1_1CURLWrapper.html">mastodonpp::CURLWrapper</a></td></tr>
<tr class="memitem:adc8808c3fad5397176f6755b09ee0be6 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structmastodonpp_1_1answer__type.html">answer_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#adc8808c3fad5397176f6755b09ee0be6">make_request</a> (const <a class="el" href="namespacemastodonpp.html#a7d60fc71ad0fb1fbd467b37fe1f1f100">http_method</a> &amp;method, string uri, const <a class="el" href="namespacemastodonpp.html#af8b3b89118adeccc71c54dfd36c987f6">parametermap</a> &amp;parameters)</td></tr>
<tr class="memdesc:adc8808c3fad5397176f6755b09ee0be6 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft">&#160;</td><td class="mdescRight">Make a HTTP request. <a href="classmastodonpp_1_1CURLWrapper.html#adc8808c3fad5397176f6755b09ee0be6">More...</a><br /></td></tr>
<tr class="separator:adc8808c3fad5397176f6755b09ee0be6 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a04b3919cfb38716c5a032337e442db95 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a04b3919cfb38716c5a032337e442db95">get_buffer</a> ()</td></tr>
<tr class="memdesc:a04b3919cfb38716c5a032337e442db95 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a reference to the buffer libcurl writes into. <a href="classmastodonpp_1_1CURLWrapper.html#a04b3919cfb38716c5a032337e442db95">More...</a><br /></td></tr>
<tr class="separator:a04b3919cfb38716c5a032337e442db95 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a892a4fc3d048798fa8e2584545b91861 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a892a4fc3d048798fa8e2584545b91861">cancel_stream</a> ()</td></tr>
<tr class="memdesc:a892a4fc3d048798fa8e2584545b91861 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft">&#160;</td><td class="mdescRight">Cancel the stream. <a href="classmastodonpp_1_1CURLWrapper.html#a892a4fc3d048798fa8e2584545b91861">More...</a><br /></td></tr>
<tr class="separator:a892a4fc3d048798fa8e2584545b91861 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7a229cf9eae6bd03adfc2fdfdff62d88 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#a7a229cf9eae6bd03adfc2fdfdff62d88">set_access_token</a> (const string_view access_token)</td></tr>
<tr class="memdesc:a7a229cf9eae6bd03adfc2fdfdff62d88 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set OAuth 2.0 Bearer Access Token. <a href="classmastodonpp_1_1CURLWrapper.html#a7a229cf9eae6bd03adfc2fdfdff62d88">More...</a><br /></td></tr>
<tr class="separator:a7a229cf9eae6bd03adfc2fdfdff62d88 inherit pro_methods_classmastodonpp_1_1CURLWrapper"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_attribs_classmastodonpp_1_1CURLWrapper"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_classmastodonpp_1_1CURLWrapper')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classmastodonpp_1_1CURLWrapper.html">mastodonpp::CURLWrapper</a></td></tr>
<tr class="memitem:aeb3171d955832b8062dc02b4ac67d195 inherit pro_attribs_classmastodonpp_1_1CURLWrapper"><td class="memItemLeft" align="right" valign="top">mutex&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmastodonpp_1_1CURLWrapper.html#aeb3171d955832b8062dc02b4ac67d195">buffer_mutex</a></td></tr>
<tr class="memdesc:aeb3171d955832b8062dc02b4ac67d195 inherit pro_attribs_classmastodonpp_1_1CURLWrapper"><td class="mdescLeft">&#160;</td><td class="mdescRight">Mutex for <a class="el" href="classmastodonpp_1_1CURLWrapper.html#a04b3919cfb38716c5a032337e442db95" title="Returns a reference to the buffer libcurl writes into.">get_buffer</a> a.k.a. _curl_buffer_body. <a href="classmastodonpp_1_1CURLWrapper.html#aeb3171d955832b8062dc02b4ac67d195">More...</a><br /></td></tr>
<tr class="separator:aeb3171d955832b8062dc02b4ac67d195 inherit pro_attribs_classmastodonpp_1_1CURLWrapper"><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>Represents a connection to an instance. Used for requests. </p>
<dl class="section since"><dt>Since</dt><dd>0.1.0 </dd></dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ac5fedffbd59686c26b1e44a7a96c216a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac5fedffbd59686c26b1e44a7a96c216a">&#9670;&nbsp;</a></span>Connection()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">mastodonpp::Connection::Connection </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classmastodonpp_1_1Instance.html">Instance</a> &amp;&#160;</td>
<td class="paramname"><em>instance</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Construct a new <a class="el" href="classmastodonpp_1_1Connection.html" title="Represents a connection to an instance. Used for requests.">Connection</a> object. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">instance</td><td>An <a class="el" href="classmastodonpp_1_1Instance.html" title="Holds the access data of an instance.">Instance</a> with the access data.</td></tr>
</table>
</dd>
</dl>
<dl class="section since"><dt>Since</dt><dd>0.1.0 </dd></dl>
<div class="fragment"><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; : _instance{instance}</div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; , _baseuri{instance.get_baseuri()}</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;{</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; <span class="keyword">auto</span> proxy{_instance.<a class="code" href="classmastodonpp_1_1Instance.html#a1d84ff4ba06446a41287f90c373368bf">get_proxy</a>()};</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; <span class="keywordflow">if</span> (!proxy.empty())</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; {</div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; <a class="code" href="classmastodonpp_1_1CURLWrapper.html#a1564a42794ef7a9d170b725063ef504d">CURLWrapper::set_proxy</a>(proxy);</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; }</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; </div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; <span class="keywordflow">if</span> (!_instance.<a class="code" href="classmastodonpp_1_1Instance.html#ab59e3ce5f1d5c00110465c6f562a1574">get_access_token</a>().empty())</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; {</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; <a class="code" href="classmastodonpp_1_1CURLWrapper.html#a7a229cf9eae6bd03adfc2fdfdff62d88">CURLWrapper::set_access_token</a>(_instance.<a class="code" href="classmastodonpp_1_1Instance.html#ab59e3ce5f1d5c00110465c6f562a1574">get_access_token</a>());</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; }</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a8cf6ab350bb359650925d1c582fe9f60"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8cf6ab350bb359650925d1c582fe9f60">&#9670;&nbsp;</a></span>cancel_stream()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void mastodonpp::Connection::cancel_stream </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Cancel the stream. </p>
<p>The stream will be cancelled, usually whithin a second. The <a class="el" href="structmastodonpp_1_1answer__type.html#a7c5582c4500034c0ea36ab1694944139">curl_error_code </a> of the answer will be set to 42 (<code>CURLE_ABORTED_BY_CALLBACK</code>).</p>
<dl class="section since"><dt>Since</dt><dd>0.1.0 </dd></dl>
<div class="fragment"><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; {</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <a class="code" href="classmastodonpp_1_1CURLWrapper.html#a892a4fc3d048798fa8e2584545b91861">CURLWrapper::cancel_stream</a>();</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a60034eabe75bd3afade110a171c66d05"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a60034eabe75bd3afade110a171c66d05">&#9670;&nbsp;</a></span>get() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structmastodonpp_1_1answer__type.html">answer_type</a> mastodonpp::Connection::get </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="namespacemastodonpp.html#ad228a850ba86374f95d9fa1fece3c33b">endpoint_variant</a> &amp;&#160;</td>
<td class="paramname"><em>endpoint</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Make a HTTP GET call. </p>
<p>Example: </p><div class="fragment"><div class="line"><span class="keyword">auto</span> answer{connection.get(<span class="stringliteral">&quot;/api/v1/instance&quot;</span>)};</div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">endpoint</td><td>Endpoint as <a class="el" href="classmastodonpp_1_1API.html#a66d340a2e61c4254feb79f17f6773e4f" title="Type for endpoints. Can be API::v1, API::v2, API::oauth, API::other or API::pleroma.">API::endpoint_type</a> or <code>std::string_view</code>.</td></tr>
</table>
</dd>
</dl>
<dl class="section since"><dt>Since</dt><dd>0.1.0 </dd></dl>
<div class="fragment"><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; {</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classmastodonpp_1_1Connection.html#ade24a99769313ee15c406d97e9543cba">get</a>(endpoint, {});</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="ade24a99769313ee15c406d97e9543cba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ade24a99769313ee15c406d97e9543cba">&#9670;&nbsp;</a></span>get() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structmastodonpp_1_1answer__type.html">answer_type</a> mastodonpp::Connection::get </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="namespacemastodonpp.html#ad228a850ba86374f95d9fa1fece3c33b">endpoint_variant</a> &amp;&#160;</td>
<td class="paramname"><em>endpoint</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="namespacemastodonpp.html#af8b3b89118adeccc71c54dfd36c987f6">parametermap</a> &amp;&#160;</td>
<td class="paramname"><em>parameters</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Make a HTTP GET call with parameters. </p>
<p>Example: </p><div class="fragment"><div class="line"><span class="keyword">auto</span> answer{connection.get(mastodonpp::API::v1::accounts_id_followers,</div>
<div class="line"> {</div>
<div class="line"> {<span class="stringliteral">&quot;id&quot;</span>, <span class="stringliteral">&quot;12&quot;</span>},</div>
<div class="line"> {<span class="stringliteral">&quot;limit&quot;</span>, <span class="stringliteral">&quot;10&quot;</span>}</div>
<div class="line"> })};</div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">endpoint</td><td>Endpoint as <a class="el" href="classmastodonpp_1_1API.html#a66d340a2e61c4254feb79f17f6773e4f" title="Type for endpoints. Can be API::v1, API::v2, API::oauth, API::other or API::pleroma.">API::endpoint_type</a> or <code>std::string_view</code>. </td></tr>
<tr><td class="paramname">parameters</td><td>A map of parameters.</td></tr>
</table>
</dd>
</dl>
<dl class="section since"><dt>Since</dt><dd>0.1.0 </dd></dl>
<div class="fragment"><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;{</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classmastodonpp_1_1CURLWrapper.html#adc8808c3fad5397176f6755b09ee0be6">make_request</a>(http_method::GET,</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; endpoint_to_uri(endpoint), parameters);</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="a7e4a50fb73aa50b027d9a0822cfde318"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7e4a50fb73aa50b027d9a0822cfde318">&#9670;&nbsp;</a></span>get_new_events()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">vector&lt; <a class="el" href="structmastodonpp_1_1event__type.html">event_type</a> &gt; mastodonpp::Connection::get_new_events </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get new stream events. </p>
<dl class="section since"><dt>Since</dt><dd>0.1.0 </dd></dl>
<div class="fragment"><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;{</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <a class="code" href="classmastodonpp_1_1CURLWrapper.html#aeb3171d955832b8062dc02b4ac67d195">buffer_mutex</a>.lock();</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="keyword">auto</span> &amp;buffer{<a class="code" href="classmastodonpp_1_1CURLWrapper.html#a04b3919cfb38716c5a032337e442db95">get_buffer</a>()};</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; vector&lt;event_type&gt; events;</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; </div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; <span class="keywordtype">size_t</span> pos{0};</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="keywordflow">while</span> ((pos = buffer.find(<span class="stringliteral">&quot;event: &quot;</span>)) != string::npos)</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; {</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="keyword">const</span> <span class="keyword">auto</span> endpos{buffer.find(<span class="stringliteral">&quot;\n\n&quot;</span>, pos)};</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keywordflow">if</span> (endpos == string::npos)</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; {</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; }</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; </div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; event_type event;</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; pos += 7; <span class="comment">// Length of &quot;event: &quot;.</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keyword">event</span>.type = buffer.substr(pos, buffer.find(<span class="charliteral">&#39;\n&#39;</span>, pos) - pos);</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; pos = buffer.find(<span class="stringliteral">&quot;data: &quot;</span>) + 6;</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keyword">event</span>.data = buffer.substr(pos, endpos - pos);</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; events.push_back(event);</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; </div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; buffer.erase(0, endpos);</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; }</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; </div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <a class="code" href="classmastodonpp_1_1CURLWrapper.html#aeb3171d955832b8062dc02b4ac67d195">buffer_mutex</a>.unlock();</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="keywordflow">return</span> events;</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="a06f537c75c7fe9a7510e11af1008e028"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a06f537c75c7fe9a7510e11af1008e028">&#9670;&nbsp;</a></span>get_new_stream_contents()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">string mastodonpp::Connection::get_new_stream_contents </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Copy new stream contents and delete the “original”. </p>
<p>Note that the last event is not necessarily complete, it could happen that you are calling this function mid-transfer. You have to check the data integrity yourself.</p>
<p>Using <a class="el" href="classmastodonpp_1_1Connection.html#a7e4a50fb73aa50b027d9a0822cfde318" title="Get new stream events.">get_new_events()</a> instead is recommended.</p>
<dl class="section since"><dt>Since</dt><dd>0.1.0 </dd></dl>
<div class="fragment"><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;{</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <a class="code" href="classmastodonpp_1_1CURLWrapper.html#aeb3171d955832b8062dc02b4ac67d195">buffer_mutex</a>.lock();</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="keyword">auto</span> &amp;buffer{<a class="code" href="classmastodonpp_1_1CURLWrapper.html#a04b3919cfb38716c5a032337e442db95">get_buffer</a>()};</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="keyword">auto</span> buffer_copy{buffer};</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; buffer.clear();</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <a class="code" href="classmastodonpp_1_1CURLWrapper.html#aeb3171d955832b8062dc02b4ac67d195">buffer_mutex</a>.unlock();</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="keywordflow">return</span> buffer_copy;</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="af27eb5d94f5a0e39a703988fdcc54173"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af27eb5d94f5a0e39a703988fdcc54173">&#9670;&nbsp;</a></span>post() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structmastodonpp_1_1answer__type.html">answer_type</a> mastodonpp::Connection::post </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="namespacemastodonpp.html#ad228a850ba86374f95d9fa1fece3c33b">endpoint_variant</a> &amp;&#160;</td>
<td class="paramname"><em>endpoint</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Make a HTTP POST call. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">endpoint</td><td>Endpoint as <a class="el" href="classmastodonpp_1_1API.html#a66d340a2e61c4254feb79f17f6773e4f" title="Type for endpoints. Can be API::v1, API::v2, API::oauth, API::other or API::pleroma.">API::endpoint_type</a> or <code>std::string_view</code>.</td></tr>
</table>
</dd>
</dl>
<dl class="section since"><dt>Since</dt><dd>0.1.0 </dd></dl>
<div class="fragment"><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; {</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classmastodonpp_1_1Connection.html#ad7cebeeef7c285ff4666dc6850f20164">post</a>(endpoint, {});</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="ad7cebeeef7c285ff4666dc6850f20164"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad7cebeeef7c285ff4666dc6850f20164">&#9670;&nbsp;</a></span>post() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structmastodonpp_1_1answer__type.html">answer_type</a> mastodonpp::Connection::post </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="namespacemastodonpp.html#ad228a850ba86374f95d9fa1fece3c33b">endpoint_variant</a> &amp;&#160;</td>
<td class="paramname"><em>endpoint</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="namespacemastodonpp.html#af8b3b89118adeccc71c54dfd36c987f6">parametermap</a> &amp;&#160;</td>
<td class="paramname"><em>parameters</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Make a HTTP POST call with parameters. </p>
<p>Example: </p><div class="fragment"><div class="line"><span class="keyword">auto</span> answer{connection.post(</div>
<div class="line"> mastodonpp::API::v1::statuses,</div>
<div class="line"> {</div>
<div class="line"> {<span class="stringliteral">&quot;status&quot;</span>, <span class="stringliteral">&quot;How is the wheather?&quot;</span>},</div>
<div class="line"> {<span class="stringliteral">&quot;poll[options]&quot;</span>, vector&lt;string_view&gt;{<span class="stringliteral">&quot;Nice&quot;</span>, <span class="stringliteral">&quot;not nice&quot;</span>}},</div>
<div class="line"> {<span class="stringliteral">&quot;poll[expires_in]&quot;</span>, to_string(poll_seconds)}</div>
<div class="line"> })};</div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">endpoint</td><td>Endpoint as <a class="el" href="classmastodonpp_1_1API.html#a66d340a2e61c4254feb79f17f6773e4f" title="Type for endpoints. Can be API::v1, API::v2, API::oauth, API::other or API::pleroma.">API::endpoint_type</a> or <code>std::string_view</code>. </td></tr>
<tr><td class="paramname">parameters</td><td>A map of parameters.</td></tr>
</table>
</dd>
</dl>
<dl class="section since"><dt>Since</dt><dd>0.1.0 </dd></dl>
<div class="fragment"><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;{</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classmastodonpp_1_1CURLWrapper.html#adc8808c3fad5397176f6755b09ee0be6">make_request</a>(http_method::POST,</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; endpoint_to_uri(endpoint), parameters);</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>include/<a class="el" href="connection_8hpp_source.html">connection.hpp</a></li>
<li>src/connection.cpp</li>
</ul>
</div><!-- contents -->
<div class="ttc" id="aclassmastodonpp_1_1Connection_html_ade24a99769313ee15c406d97e9543cba"><div class="ttname"><a href="classmastodonpp_1_1Connection.html#ade24a99769313ee15c406d97e9543cba">mastodonpp::Connection::get</a></div><div class="ttdeci">answer_type get(const endpoint_variant &amp;endpoint, const parametermap &amp;parameters)</div><div class="ttdoc">Make a HTTP GET call with parameters.</div><div class="ttdef"><b>Definition:</b> connection.cpp:50</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Instance_html_a1d84ff4ba06446a41287f90c373368bf"><div class="ttname"><a href="classmastodonpp_1_1Instance.html#a1d84ff4ba06446a41287f90c373368bf">mastodonpp::Instance::get_proxy</a></div><div class="ttdeci">string_view get_proxy() const</div><div class="ttdoc">Returns the proxy string that was previously set.</div><div class="ttdef"><b>Definition:</b> instance.hpp:132</div></div>
<div class="ttc" id="aclassmastodonpp_1_1CURLWrapper_html_a7a229cf9eae6bd03adfc2fdfdff62d88"><div class="ttname"><a href="classmastodonpp_1_1CURLWrapper.html#a7a229cf9eae6bd03adfc2fdfdff62d88">mastodonpp::CURLWrapper::set_access_token</a></div><div class="ttdeci">void set_access_token(const string_view access_token)</div><div class="ttdoc">Set OAuth 2.0 Bearer Access Token.</div><div class="ttdef"><b>Definition:</b> curl_wrapper.cpp:170</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Instance_html_ab59e3ce5f1d5c00110465c6f562a1574"><div class="ttname"><a href="classmastodonpp_1_1Instance.html#ab59e3ce5f1d5c00110465c6f562a1574">mastodonpp::Instance::get_access_token</a></div><div class="ttdeci">string_view get_access_token() const</div><div class="ttdoc">Returns the access token.</div><div class="ttdef"><b>Definition:</b> instance.hpp:87</div></div>
<div class="ttc" id="aclassmastodonpp_1_1CURLWrapper_html_aeb3171d955832b8062dc02b4ac67d195"><div class="ttname"><a href="classmastodonpp_1_1CURLWrapper.html#aeb3171d955832b8062dc02b4ac67d195">mastodonpp::CURLWrapper::buffer_mutex</a></div><div class="ttdeci">mutex buffer_mutex</div><div class="ttdoc">Mutex for get_buffer a.k.a. _curl_buffer_body.</div><div class="ttdef"><b>Definition:</b> curl_wrapper.hpp:164</div></div>
<div class="ttc" id="aclassmastodonpp_1_1CURLWrapper_html_a04b3919cfb38716c5a032337e442db95"><div class="ttname"><a href="classmastodonpp_1_1CURLWrapper.html#a04b3919cfb38716c5a032337e442db95">mastodonpp::CURLWrapper::get_buffer</a></div><div class="ttdeci">string &amp; get_buffer()</div><div class="ttdoc">Returns a reference to the buffer libcurl writes into.</div><div class="ttdef"><b>Definition:</b> curl_wrapper.hpp:185</div></div>
<div class="ttc" id="aclassmastodonpp_1_1CURLWrapper_html_a1564a42794ef7a9d170b725063ef504d"><div class="ttname"><a href="classmastodonpp_1_1CURLWrapper.html#a1564a42794ef7a9d170b725063ef504d">mastodonpp::CURLWrapper::set_proxy</a></div><div class="ttdeci">void set_proxy(string_view proxy)</div><div class="ttdoc">Set the proxy to use.</div><div class="ttdef"><b>Definition:</b> curl_wrapper.cpp:67</div></div>
<div class="ttc" id="aclassmastodonpp_1_1Connection_html_ad7cebeeef7c285ff4666dc6850f20164"><div class="ttname"><a href="classmastodonpp_1_1Connection.html#ad7cebeeef7c285ff4666dc6850f20164">mastodonpp::Connection::post</a></div><div class="ttdeci">answer_type post(const endpoint_variant &amp;endpoint, const parametermap &amp;parameters)</div><div class="ttdoc">Make a HTTP POST call with parameters.</div><div class="ttdef"><b>Definition:</b> connection.cpp:57</div></div>
<div class="ttc" id="aclassmastodonpp_1_1CURLWrapper_html_adc8808c3fad5397176f6755b09ee0be6"><div class="ttname"><a href="classmastodonpp_1_1CURLWrapper.html#adc8808c3fad5397176f6755b09ee0be6">mastodonpp::CURLWrapper::make_request</a></div><div class="ttdeci">answer_type make_request(const http_method &amp;method, string uri, const parametermap &amp;parameters)</div><div class="ttdoc">Make a HTTP request.</div><div class="ttdef"><b>Definition:</b> curl_wrapper.cpp:77</div></div>
<div class="ttc" id="aclassmastodonpp_1_1CURLWrapper_html_a892a4fc3d048798fa8e2584545b91861"><div class="ttname"><a href="classmastodonpp_1_1CURLWrapper.html#a892a4fc3d048798fa8e2584545b91861">mastodonpp::CURLWrapper::cancel_stream</a></div><div class="ttdeci">void cancel_stream()</div><div class="ttdoc">Cancel the stream.</div><div class="ttdef"><b>Definition:</b> curl_wrapper.hpp:199</div></div>
<!-- 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.16
</small></address>
</body>
</html>