Interface IWebMClient

Current version: 3.4

Provides additional features to the default SDK, specifically for HTTP and REST.

Namespace: StylelabsStylelabs.MSdkWebClient
Assembly: Stylelabs.M.Sdk.WebClient.dll
Syntax
RequestResponse
public interface IWebMClient : IMClient

Properties

Api

Gets contains functionality to get REST API information. It will also check for compatibility with the server REST API.

Declaration
RequestResponse
IApiClient Api { get; }
Property Value
TypeDescription
IApiClient

ImpersonatedUsername

Gets the name of the user being impersonated. This is null when impersonation is not active.

Declaration
RequestResponse
string ImpersonatedUsername { get; }
Property Value
TypeDescription
string

LinkHelper

Gets contains functionality to build and parse links.

Declaration
RequestResponse
ILinkHelper LinkHelper { get; }
Property Value
TypeDescription
ILinkHelper

Package

Gets contains functionality to import and export packages.

Declaration
RequestResponse
IPackageClient Package { get; }
Property Value
TypeDescription
IPackageClient

Raw

Gets contains functionality to do custom HTTP requests.

Declaration
RequestResponse
IRawClient Raw { get; }
Property Value
TypeDescription
IRawClient

Uploads

Gets contains functionality for file uploads.

Declaration
RequestResponse
IUploadClient Uploads { get; }
Property Value
TypeDescription
IUploadClient

Methods

SetDelegatingHandlerFactory(IDelegatingHandlerFactory)

Sets a factory that will be used to create a

      <see cref="!:System.Net.Http.DelegatingHandler"></see>on the first request per specific protocol and host.
      The handler will be reused for the next requests.
    </p>
  </div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration" id="declaration-6">Declaration</h5>
  <div class="codewrapper">
    <div data-rehype-pretty-code-fragment=""><pre data-language="shell" data-theme="default"><code data-language="shell" data-theme="default"><span class="line"><span style="color: #61AFEF">void</span><span style="color: #ABB2BF"> </span><span style="color: #98C379">SetDelegatingHandlerFactory</span><span style="color: #ABB2BF">(</span><span style="color: #61AFEF">IDelegatingHandlerFactory</span><span style="color: #ABB2BF"> </span><span style="color: #98C379">factory</span><span style="color: #ABB2BF">)</span></span></code></pre></div>
  </div>
  <h5 class="parameters" id="parameters">Parameters</h5>
  <div class="informaltable table-responsive">
    <table class="table table-bordered table-striped table-condensed informaltable frame-void rules-rows">
      <thead>
        <tr>
          <th>Type</th>
          <th>Name</th>
          <th>Description</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><a class="xref" href="web-sdk--stylelabs.m.sdk.webclient.http.idelegatinghandlerfactory.html">IDelegatingHandlerFactory</a></td>
          <td><span class="parametername">factory</span></td>
          <td>
            <p>The http client factory.</p>
          </td>
        </tr>
      </tbody>
    </table>
  </div><a id="Stylelabs_M_Sdk_WebClient_IWebMClient_SetHttpClientFactory_" data-uid="Stylelabs.M.Sdk.WebClient.IWebMClient.SetHttpClientFactory*"></a>
  <h4 id="Stylelabs_M_Sdk_WebClient_IWebMClient_SetHttpClientFactory_Stylelabs_M_Sdk_WebClient_Http_IHttpClientFactory_" data-uid="Stylelabs.M.Sdk.WebClient.IWebMClient.SetHttpClientFactory(Stylelabs.M.Sdk.WebClient.Http.IHttpClientFactory)">SetHttpClientFactory(IHttpClientFactory)</h4>
  <div class="markdown level1 summary">
    <p>
      Sets a factory that will be used to create a
      
      <see cref="!:System.Net.Http.HttpClient"></see>on the first request per specific protocol and host.
      The client will be reused for the next requests.
    </p>
  </div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration" id="declaration-7">Declaration</h5>
  <div class="codewrapper">
    <div data-rehype-pretty-code-fragment=""><pre data-language="shell" data-theme="default"><code data-language="shell" data-theme="default"><span class="line"><span style="color: #61AFEF">void</span><span style="color: #ABB2BF"> </span><span style="color: #98C379">SetHttpClientFactory</span><span style="color: #ABB2BF">(</span><span style="color: #61AFEF">IHttpClientFactory</span><span style="color: #ABB2BF"> </span><span style="color: #98C379">factory</span><span style="color: #ABB2BF">)</span></span></code></pre></div>
  </div>
  <h5 class="parameters" id="parameters-1">Parameters</h5>
  <div class="informaltable table-responsive">
    <table class="table table-bordered table-striped table-condensed informaltable frame-void rules-rows">
      <thead>
        <tr>
          <th>Type</th>
          <th>Name</th>
          <th>Description</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><a class="xref" href="web-sdk--stylelabs.m.sdk.webclient.http.ihttpclientfactory.html">IHttpClientFactory</a></td>
          <td><span class="parametername">factory</span></td>
          <td>
            <p>The http client factory.</p>
          </td>
        </tr>
      </tbody>
    </table>
  </div><a id="Stylelabs_M_Sdk_WebClient_IWebMClient_SetKnownSSoRedirects_" data-uid="Stylelabs.M.Sdk.WebClient.IWebMClient.SetKnownSSoRedirects*"></a>
  <h4 id="Stylelabs_M_Sdk_WebClient_IWebMClient_SetKnownSSoRedirects_IEnumerable_Uri__" data-uid="Stylelabs.M.Sdk.WebClient.IWebMClient.SetKnownSSoRedirects(IEnumerable{Uri})">SetKnownSSoRedirects(IEnumerable&#x3C;Uri>)</h4>
  <div class="markdown level1 summary">
    <p>Set known SSO redirect URls that must trigger security token refreshes.</p>
  </div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration" id="declaration-8">Declaration</h5>
  <div class="codewrapper">
    <div data-rehype-pretty-code-fragment=""><pre data-language="shell" data-theme="default"><code data-language="shell" data-theme="default"><span class="line"><span style="color: #61AFEF">void</span><span style="color: #ABB2BF"> </span><span style="color: #98C379">SetKnownSSoRedirects</span><span style="color: #ABB2BF">(</span><span style="color: #61AFEF">IEnumerable&#x3C;Uri></span><span style="color: #ABB2BF"> </span><span style="color: #98C379">ssoRedirects</span><span style="color: #ABB2BF">)</span></span></code></pre></div>
  </div>
  <h5 class="parameters" id="parameters-2">Parameters</h5>
  <div class="informaltable table-responsive">
    <table class="table table-bordered table-striped table-condensed informaltable frame-void rules-rows">
      <thead>
        <tr>
          <th>Type</th>
          <th>Name</th>
          <th>Description</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><span class="xref">IEnumerable&#x3C;></span><span class="xref">Uri</span></td>
          <td><span class="parametername">ssoRedirects</span></td>
          <td>
            <p>SSO URls.</p>
          </td>
        </tr>
      </tbody>
    </table>
  </div><a id="Stylelabs_M_Sdk_WebClient_IWebMClient_TestConnectionAsync_" data-uid="Stylelabs.M.Sdk.WebClient.IWebMClient.TestConnectionAsync*"></a>
  <h4 id="Stylelabs_M_Sdk_WebClient_IWebMClient_TestConnectionAsync" data-uid="Stylelabs.M.Sdk.WebClient.IWebMClient.TestConnectionAsync">TestConnectionAsync()</h4>
  <div class="markdown level1 summary">
    <p>Tests the following things:</p>
    <ul>
      <li>if the client can successfully connect to the server</li>
      <li>if the SDK and server are compatible</li>
      <li>
        if the credentials are correct
        This will throw exceptions if it failed to connect.
        The exception type depends on what failed.
      </li>
    </ul>
  </div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration" id="declaration-9">Declaration</h5>
  <div class="codewrapper">
    <div data-rehype-pretty-code-fragment=""><pre data-language="shell" data-theme="default"><code data-language="shell" data-theme="default"><span class="line"><span style="color: #61AFEF">Task</span><span style="color: #ABB2BF"> </span><span style="color: #98C379">TestConnectionAsync</span><span style="color: #ABB2BF">()</span></span></code></pre></div>
  </div>
  <h5 class="returns" id="returns">Returns</h5>
  <div class="informaltable table-responsive">
    <table class="table table-bordered table-striped table-condensed informaltable frame-void rules-rows">
      <thead>
        <tr>
          <th>Type</th>
          <th>Description</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><span class="xref">Task</span></td>
          <td>
            <p>A 
              <see cref="!:Task"></see>representing the asynchronous operation.
            </p>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
  <h3 id="events">Events</h3>
  <h4 id="Stylelabs_M_Sdk_WebClient_IWebMClient_RefreshTokenReceived" data-uid="Stylelabs.M.Sdk.WebClient.IWebMClient.RefreshTokenReceived">RefreshTokenReceived</h4>
  <div class="markdown level1 summary">
    <p>Triggered when a new refresh-token has been received.</p>
  </div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration" id="declaration-10">Declaration</h5>
  <div class="codewrapper">
    <div data-rehype-pretty-code-fragment=""><pre data-language="shell" data-theme="default"><code data-language="shell" data-theme="default"><span class="line"><span style="color: #61AFEF">event</span><span style="color: #ABB2BF"> </span><span style="color: #98C379">EventHandler</span><span style="color: #ABB2BF">&#x3C;</span><span style="color: #98C379">RefreshTokenReceivedEventArg</span><span style="color: #ABB2BF">s> </span><span style="color: #98C379">RefreshTokenReceived</span></span></code></pre></div>
  </div>
  <h5 class="eventType" id="event-type">Event Type</h5>
  <div class="informaltable table-responsive">
    <table class="table table-bordered table-striped table-condensed informaltable frame-void rules-rows">
      <thead>
        <tr>
          <th>Type</th>
          <th>Description</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><span class="xref">EventHandler&#x3C;></span><a class="xref" href="web-sdk--stylelabs.m.sdk.webclient.http.refreshtokenreceivedeventargs.html">RefreshTokenReceivedEventArgs</a></td>
          <td></td>
        </tr>
      </tbody>
    </table>
  </div>
  <h4 id="Stylelabs_M_Sdk_WebClient_IWebMClient_RequestCreated" data-uid="Stylelabs.M.Sdk.WebClient.IWebMClient.RequestCreated">RequestCreated</h4>
  <div class="markdown level1 summary">
    <p>Triggered when a web-request has been created.</p>
  </div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration" id="declaration-11">Declaration</h5>
  <div class="codewrapper">
    <div data-rehype-pretty-code-fragment=""><pre data-language="shell" data-theme="default"><code data-language="shell" data-theme="default"><span class="line"><span style="color: #61AFEF">event</span><span style="color: #ABB2BF"> </span><span style="color: #98C379">EventHandler</span><span style="color: #ABB2BF">&#x3C;</span><span style="color: #98C379">RequestCreatedEventArg</span><span style="color: #ABB2BF">s> </span><span style="color: #98C379">RequestCreated</span></span></code></pre></div>
  </div>
  <h5 class="eventType" id="event-type-1">Event Type</h5>
  <div class="informaltable table-responsive">
    <table class="table table-bordered table-striped table-condensed informaltable frame-void rules-rows">
      <thead>
        <tr>
          <th>Type</th>
          <th>Description</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><span class="xref">EventHandler&#x3C;></span><a class="xref" href="web-sdk--stylelabs.m.sdk.webclient.http.requestcreatedeventargs.html">RequestCreatedEventArgs</a></td>
          <td></td>
        </tr>
      </tbody>
    </table>
  </div>
</section>
<div class="footer-content">
  <div class="glossary-definitions"></div>
</div>
<footer></footer>

Do you have some feedback for us?

If you have suggestions for improving this article,