|
static void | PostRequest (string url, Dictionary< string, string > headers, string body, Action< UnityWebRequest, bool > callBack=null) |
| Send a post request More...
|
|
|
static IEnumerator | RunPost (string url, Dictionary< string, string > headers, string body, Action< UnityWebRequest, bool > callBack) |
| Run post request More...
|
|
Definition at line 10 of file Rest.cs.
◆ PostRequest()
static void BGC.Web.Utility.Rest.PostRequest |
( |
string |
url, |
|
|
Dictionary< string, string > |
headers, |
|
|
string |
body, |
|
|
Action< UnityWebRequest, bool > |
callBack = null |
|
) |
| |
|
inlinestatic |
Send a post request
- Parameters
-
callBack | true means there was an error |
Definition at line 16 of file Rest.cs.
References BGC.Utility.CoroutineUtility.Mono.
static IEnumerator RunPost(string url, Dictionary< string, string > headers, string body, Action< UnityWebRequest, bool > callBack)
Run post request
static MonoBehaviour Mono
◆ RunPost()
static IEnumerator BGC.Web.Utility.Rest.RunPost |
( |
string |
url, |
|
|
Dictionary< string, string > |
headers, |
|
|
string |
body, |
|
|
Action< UnityWebRequest, bool > |
callBack |
|
) |
| |
|
inlinestaticprivate |
Run post request
- Parameters
-
callBack | boolean true means there was an error |
- Returns
Definition at line 34 of file Rest.cs.
40 UnityWebRequest request = UnityWebRequest.Post(url,
"");
41 request.uploadHandler =
new UploadHandlerRaw(Encoding.UTF8.GetBytes(body));
43 foreach (KeyValuePair<string, string> pair
in headers)
45 request.SetRequestHeader(pair.Key, pair.Value);
48 yield
return request.SendWebRequest();
49 callBack?.Invoke(request,
true);
The documentation for this class was generated from the following file: