Skip to content

Mirror::Cloud::RequestCreator

Methods to create and send UnityWebRequest

Inherits from IRequestCreator

Public Functions

Name
RequestCreator(string baseAddress, string apiKey, ICoroutineRunner coroutineRunner)
UnityWebRequest Get(string page)
Create Get Request to page
UnityWebRequest Post< T >(string page, T json)
Creates Post Request to page with Json body
UnityWebRequest Patch< T >(string page, T json)
Creates Patch Request to page with Json body
UnityWebRequest Delete(string page)
Create Delete Request to page
void SendRequest(UnityWebRequest request, RequestSuccess onSuccess =null, RequestFail onFail =null)
Sends Request to api and invokes callback when finished
IEnumerator SendRequestEnumerator(UnityWebRequest request, RequestSuccess onSuccess =null, RequestFail onFail =null)
Sends Request to api and invokes callback when finished

Public Attributes

Name
readonly string baseAddress
readonly string apiKey

Public Functions Documentation

function RequestCreator

inline RequestCreator(
    string baseAddress,
    string apiKey,
    ICoroutineRunner coroutineRunner
)

function Get

inline UnityWebRequest Get(
    string page
)

Create Get Request to page

Parameters:

  • page

Return:

Reimplements: Mirror::Cloud::IRequestCreator::Get

function Post< T >

inline UnityWebRequest Post< T >(
    string page,
    T json
)

Creates Post Request to page with Json body

Parameters:

  • page
  • json

Template Parameters:

  • T

Return:

Reimplements: Mirror::Cloud::IRequestCreator::Post< T >

function Patch< T >

inline UnityWebRequest Patch< T >(
    string page,
    T json
)

Creates Patch Request to page with Json body

Parameters:

  • page
  • json

Template Parameters:

  • T

Return:

Reimplements: Mirror::Cloud::IRequestCreator::Patch< T >

function Delete

inline UnityWebRequest Delete(
    string page
)

Create Delete Request to page

Parameters:

  • page

Return:

Reimplements: Mirror::Cloud::IRequestCreator::Delete

function SendRequest

inline void SendRequest(
    UnityWebRequest request,
    RequestSuccess onSuccess =null,
    RequestFail onFail =null
)

Sends Request to api and invokes callback when finished

Parameters:

  • request
  • onSuccess
  • onFail

Reimplements: Mirror::Cloud::IRequestCreator::SendRequest

Starts Coroutine of SendRequestEnumerator

function SendRequestEnumerator

inline IEnumerator SendRequestEnumerator(
    UnityWebRequest request,
    RequestSuccess onSuccess =null,
    RequestFail onFail =null
)

Sends Request to api and invokes callback when finished

Parameters:

  • request
  • onSuccess
  • onFail

Return:

Reimplements: Mirror::Cloud::IRequestCreator::SendRequestEnumerator

Public Attributes Documentation

variable baseAddress

readonly string baseAddress;

variable apiKey

readonly string apiKey;

Updated on 24 January 2021 at 23:47:09 UTC