Dalamud/docs/api/Discord.Net.Rest.IRestClient.html
2020-03-11 21:54:11 +09:00

425 lines
20 KiB
HTML

<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Interface IRestClient
</title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Interface IRestClient
">
<meta name="generator" content="docfx 2.50.0.0">
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" href="../styles/docfx.vendor.css">
<link rel="stylesheet" href="../styles/docfx.css">
<link rel="stylesheet" href="../styles/main.css">
<meta property="docfx:navrel" content="">
<meta property="docfx:tocrel" content="toc.html">
</head>
<body data-spy="scroll" data-target="#affix" data-offset="120">
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../logo.svg" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
</header>
<div role="main" class="container body-content hide-when-search">
<div class="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="Discord.Net.Rest.IRestClient">
<h1 id="Discord_Net_Rest_IRestClient" data-uid="Discord.Net.Rest.IRestClient" class="text-break">Interface IRestClient
</h1>
<div class="markdown level0 summary"><p>Represents a generic REST-based client.</p>
</div>
<div class="markdown level0 conceptual"></div>
<div class="inheritedMembers">
<h5>Inherited Members</h5>
<div>
<span class="xref">System.IDisposable.Dispose()</span>
</div>
</div>
<h6><strong>Namespace</strong>: <a class="xref" href="Discord.Net.Rest.html">Discord.Net.Rest</a></h6>
<h6><strong>Assembly</strong>: Discord.Net.Core.dll</h6>
<h5 id="Discord_Net_Rest_IRestClient_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public interface IRestClient : IDisposable</code></pre>
</div>
<h3 id="methods">Methods
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/goaaats/Discord.Net/new/819a325cec923e4a817ab2f08be5c7bbe0d775d0/apiSpec/new?filename=Discord_Net_Rest_IRestClient_SendAsync_System_String_System_String_System_Collections_Generic_IReadOnlyDictionary_System_String_System_Object__System_Threading_CancellationToken_System_Boolean_System_String_.md&amp;value=---%0Auid%3A%20Discord.Net.Rest.IRestClient.SendAsync(System.String%2CSystem.String%2CSystem.Collections.Generic.IReadOnlyDictionary%7BSystem.String%2CSystem.Object%7D%2CSystem.Threading.CancellationToken%2CSystem.Boolean%2CSystem.String)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/goaaats/Discord.Net/blob/819a325cec923e4a817ab2f08be5c7bbe0d775d0/src/Discord.Net.Core/Net/Rest/IRestClient.cs/#L36">View Source</a>
</span>
<a id="Discord_Net_Rest_IRestClient_SendAsync_" data-uid="Discord.Net.Rest.IRestClient.SendAsync*"></a>
<h4 id="Discord_Net_Rest_IRestClient_SendAsync_System_String_System_String_System_Collections_Generic_IReadOnlyDictionary_System_String_System_Object__System_Threading_CancellationToken_System_Boolean_System_String_" data-uid="Discord.Net.Rest.IRestClient.SendAsync(System.String,System.String,System.Collections.Generic.IReadOnlyDictionary{System.String,System.Object},System.Threading.CancellationToken,System.Boolean,System.String)">SendAsync(String, String, IReadOnlyDictionary&lt;String, Object&gt;, CancellationToken, Boolean, String)</h4>
<div class="markdown level1 summary"></div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">Task&lt;RestResponse&gt; SendAsync(string method, string endpoint, IReadOnlyDictionary&lt;string, object&gt; multipartParams, CancellationToken cancelToken, bool headerOnly = false, string reason = null)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">method</span></td>
<td></td>
</tr>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">endpoint</span></td>
<td></td>
</tr>
<tr>
<td><span class="xref">System.Collections.Generic.IReadOnlyDictionary</span>&lt;<span class="xref">System.String</span>, <span class="xref">System.Object</span>&gt;</td>
<td><span class="parametername">multipartParams</span></td>
<td></td>
</tr>
<tr>
<td><span class="xref">System.Threading.CancellationToken</span></td>
<td><span class="parametername">cancelToken</span></td>
<td></td>
</tr>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><span class="parametername">headerOnly</span></td>
<td></td>
</tr>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">reason</span></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Threading.Tasks.Task</span>&lt;<a class="xref" href="Discord.Net.Rest.RestResponse.html">RestResponse</a>&gt;</td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/goaaats/Discord.Net/new/819a325cec923e4a817ab2f08be5c7bbe0d775d0/apiSpec/new?filename=Discord_Net_Rest_IRestClient_SendAsync_System_String_System_String_System_String_System_Threading_CancellationToken_System_Boolean_System_String_.md&amp;value=---%0Auid%3A%20Discord.Net.Rest.IRestClient.SendAsync(System.String%2CSystem.String%2CSystem.String%2CSystem.Threading.CancellationToken%2CSystem.Boolean%2CSystem.String)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/goaaats/Discord.Net/blob/819a325cec923e4a817ab2f08be5c7bbe0d775d0/src/Discord.Net.Core/Net/Rest/IRestClient.cs/#L35">View Source</a>
</span>
<a id="Discord_Net_Rest_IRestClient_SendAsync_" data-uid="Discord.Net.Rest.IRestClient.SendAsync*"></a>
<h4 id="Discord_Net_Rest_IRestClient_SendAsync_System_String_System_String_System_String_System_Threading_CancellationToken_System_Boolean_System_String_" data-uid="Discord.Net.Rest.IRestClient.SendAsync(System.String,System.String,System.String,System.Threading.CancellationToken,System.Boolean,System.String)">SendAsync(String, String, String, CancellationToken, Boolean, String)</h4>
<div class="markdown level1 summary"></div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">Task&lt;RestResponse&gt; SendAsync(string method, string endpoint, string json, CancellationToken cancelToken, bool headerOnly = false, string reason = null)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">method</span></td>
<td></td>
</tr>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">endpoint</span></td>
<td></td>
</tr>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">json</span></td>
<td></td>
</tr>
<tr>
<td><span class="xref">System.Threading.CancellationToken</span></td>
<td><span class="parametername">cancelToken</span></td>
<td></td>
</tr>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><span class="parametername">headerOnly</span></td>
<td></td>
</tr>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">reason</span></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Threading.Tasks.Task</span>&lt;<a class="xref" href="Discord.Net.Rest.RestResponse.html">RestResponse</a>&gt;</td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/goaaats/Discord.Net/new/819a325cec923e4a817ab2f08be5c7bbe0d775d0/apiSpec/new?filename=Discord_Net_Rest_IRestClient_SendAsync_System_String_System_String_System_Threading_CancellationToken_System_Boolean_System_String_.md&amp;value=---%0Auid%3A%20Discord.Net.Rest.IRestClient.SendAsync(System.String%2CSystem.String%2CSystem.Threading.CancellationToken%2CSystem.Boolean%2CSystem.String)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/goaaats/Discord.Net/blob/819a325cec923e4a817ab2f08be5c7bbe0d775d0/src/Discord.Net.Core/Net/Rest/IRestClient.cs/#L34">View Source</a>
</span>
<a id="Discord_Net_Rest_IRestClient_SendAsync_" data-uid="Discord.Net.Rest.IRestClient.SendAsync*"></a>
<h4 id="Discord_Net_Rest_IRestClient_SendAsync_System_String_System_String_System_Threading_CancellationToken_System_Boolean_System_String_" data-uid="Discord.Net.Rest.IRestClient.SendAsync(System.String,System.String,System.Threading.CancellationToken,System.Boolean,System.String)">SendAsync(String, String, CancellationToken, Boolean, String)</h4>
<div class="markdown level1 summary"><p>Sends a REST request.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">Task&lt;RestResponse&gt; SendAsync(string method, string endpoint, CancellationToken cancelToken, bool headerOnly = false, string reason = null)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">method</span></td>
<td><p>The method used to send this request (i.e. HTTP verb such as <code>GET</code>, <code>POST</code>).</p>
</td>
</tr>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">endpoint</span></td>
<td><p>The endpoint to send this request to.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Threading.CancellationToken</span></td>
<td><span class="parametername">cancelToken</span></td>
<td><p>The cancellation token used to cancel the task.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><span class="parametername">headerOnly</span></td>
<td><p>Indicates whether to send the header only.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">reason</span></td>
<td><p>The audit log reason.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Threading.Tasks.Task</span>&lt;<a class="xref" href="Discord.Net.Rest.RestResponse.html">RestResponse</a>&gt;</td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/goaaats/Discord.Net/new/819a325cec923e4a817ab2f08be5c7bbe0d775d0/apiSpec/new?filename=Discord_Net_Rest_IRestClient_SetCancelToken_System_Threading_CancellationToken_.md&amp;value=---%0Auid%3A%20Discord.Net.Rest.IRestClient.SetCancelToken(System.Threading.CancellationToken)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/goaaats/Discord.Net/blob/819a325cec923e4a817ab2f08be5c7bbe0d775d0/src/Discord.Net.Core/Net/Rest/IRestClient.cs/#L23">View Source</a>
</span>
<a id="Discord_Net_Rest_IRestClient_SetCancelToken_" data-uid="Discord.Net.Rest.IRestClient.SetCancelToken*"></a>
<h4 id="Discord_Net_Rest_IRestClient_SetCancelToken_System_Threading_CancellationToken_" data-uid="Discord.Net.Rest.IRestClient.SetCancelToken(System.Threading.CancellationToken)">SetCancelToken(CancellationToken)</h4>
<div class="markdown level1 summary"><p>Sets the cancellation token for this client.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">void SetCancelToken(CancellationToken cancelToken)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Threading.CancellationToken</span></td>
<td><span class="parametername">cancelToken</span></td>
<td><p>The cancellation token.</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/goaaats/Discord.Net/new/819a325cec923e4a817ab2f08be5c7bbe0d775d0/apiSpec/new?filename=Discord_Net_Rest_IRestClient_SetHeader_System_String_System_String_.md&amp;value=---%0Auid%3A%20Discord.Net.Rest.IRestClient.SetHeader(System.String%2CSystem.String)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/goaaats/Discord.Net/blob/819a325cec923e4a817ab2f08be5c7bbe0d775d0/src/Discord.Net.Core/Net/Rest/IRestClient.cs/#L18">View Source</a>
</span>
<a id="Discord_Net_Rest_IRestClient_SetHeader_" data-uid="Discord.Net.Rest.IRestClient.SetHeader*"></a>
<h4 id="Discord_Net_Rest_IRestClient_SetHeader_System_String_System_String_" data-uid="Discord.Net.Rest.IRestClient.SetHeader(System.String,System.String)">SetHeader(String, String)</h4>
<div class="markdown level1 summary"><p>Sets the HTTP header of this client for all requests.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">void SetHeader(string key, string value)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">key</span></td>
<td><p>The field name of the header.</p>
</td>
</tr>
<tr>
<td><span class="xref">System.String</span></td>
<td><span class="parametername">value</span></td>
<td><p>The value of the header.</p>
</td>
</tr>
</tbody>
</table>
</article>
</div>
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<div class="contribution">
<ul class="nav">
<li>
<a href="https://github.com/goaaats/Discord.Net/new/819a325cec923e4a817ab2f08be5c7bbe0d775d0/apiSpec/new?filename=Discord_Net_Rest_IRestClient.md&amp;value=---%0Auid%3A%20Discord.Net.Rest.IRestClient%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a>
</li>
<li>
<a href="https://github.com/goaaats/Discord.Net/blob/819a325cec923e4a817ab2f08be5c7bbe0d775d0/src/Discord.Net.Core/Net/Rest/IRestClient.cs/#L11" class="contribution-link">View Source</a>
</li>
</ul>
</div>
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
</nav>
</div>
</div>
</div>
</div>
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
<span>Generated by <strong>DocFX</strong></span>
</div>
</div>
</footer>
</div>
<script type="text/javascript" src="../styles/docfx.vendor.js"></script>
<script type="text/javascript" src="../styles/docfx.js"></script>
<script type="text/javascript" src="../styles/main.js"></script>
</body>
</html>