Hydrogen Framework  1.3.1
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Hydrogen.Core.WebPool Class Reference

An internal web pool system used within the Hydrogen Framework. More...

+ Inheritance diagram for Hydrogen.Core.WebPool:

Classes

struct  FormBinaryData
 Form Data Structure More...
 

Public Member Functions

void Form (string URI, Dictionary< string, string > formStringData)
 HTTP POST Form to URI. More...
 
void Form (string URI, Dictionary< string, string > formStringData, FormBinaryData[] formBinaryData, string cookie, System.Action< int, Hashtable, string > callback)
 HTTP POST Form to URI. More...
 
*< returns > Call Hashcode
</returns > *int 
GET (string URI)
 HTTP GET Request to URI More...
 
int GET (string URI, System.Action< int, Hashtable, string > callback)
 HTTP GET Request to URI More...
 
int GET (string URI, string cookie, System.Action< int, Hashtable, string > callback)
 HTTP GET Request to URI More...
 
void POST (string URI, string contentType, string payload)
 HTTP POST Request to URI. More...
 
void POST (string URI, string contentType, string payload, string cookie, System.Action< int, Hashtable, string > callback)
 HTTP POST Request to URI. More...
 

Protected Member Functions

virtual void Awake ()
 Unity's Awake Event More...
 

Detailed Description

An internal web pool system used within the Hydrogen Framework.

Definition at line 39 of file WebPool.cs.

Member Function Documentation

virtual void Hydrogen.Core.WebPool.Awake ( )
protectedvirtual

Unity's Awake Event

Reimplemented in hWebPool.

Definition at line 165 of file WebPool.cs.

166  {
167  StartCoroutine (Initialize ());
168  }
void Hydrogen.Core.WebPool.Form ( string  URI,
Dictionary< string, string >  formStringData 
)

HTTP POST Form to URI.

Parameters
URIThe Target URI
formStringDataA Dictionary<string,string> of Form Data
Returns
Call Hashcode

Definition at line 63 of file WebPool.cs.

64  {
65  Form (URI, formStringData, null, null, null);
66  }
void Form(string URI, Dictionary< string, string > formStringData)
HTTP POST Form to URI.
Definition: WebPool.cs:63
void Hydrogen.Core.WebPool.Form ( string  URI,
Dictionary< string, string >  formStringData,
FormBinaryData[]  formBinaryData,
string  cookie,
System.Action< int, Hashtable, string >  callback 
)

HTTP POST Form to URI.

Parameters
URIThe Target URI
formStringDataA Dictionary<string,string> of Form Data
formBinaryDataA custom binary dataset. Useful for uploading pictures.
cookieAny previous cookie data to be used for authentication.
callbackA callback function (int hash, Hashtable headers, string payload).
Returns
Call Hashcode

Definition at line 77 of file WebPool.cs.

78  {
79  if (!_initialized) {
80  Debug.LogError ("WebPool has not finished initializing ... " +
81  "Did you call this function without having either a WebPool or ObjectPool component " +
82  "already on a MonoBehaviour?");
83  return;
84  }
85  GameObject go = _poolReference.Spawn (_poolID);
86  go.GetComponent<WebPoolWorker> ().Form (URI, formStringData, formBinaryData, cookie, callback);
87  }
void Form(string URI, Dictionary< string, string > formStringData)
HTTP POST Form to URI.
Definition: WebPool.cs:63
*<returns> Call Hashcode</returns>* int Hydrogen.Core.WebPool.GET ( string  URI)

HTTP GET Request to URI

Parameters
URIThe Target URI

Definition at line 94 of file WebPool.cs.

95  {
96  return GET (URI, null, null);
97  }
*< returns > Call Hashcode</returns > *int GET(string URI)
HTTP GET Request to URI
Definition: WebPool.cs:94
int Hydrogen.Core.WebPool.GET ( string  URI,
System.Action< int, Hashtable, string >  callback 
)

HTTP GET Request to URI

Parameters
URIThe Target URI
callbackA callback function (int hash, Hashtable headers, string payload).
Returns
Call Hashcode

Definition at line 105 of file WebPool.cs.

106  {
107  return GET (URI, null, callback);
108  }
*< returns > Call Hashcode</returns > *int GET(string URI)
HTTP GET Request to URI
Definition: WebPool.cs:94
int Hydrogen.Core.WebPool.GET ( string  URI,
string  cookie,
System.Action< int, Hashtable, string >  callback 
)

HTTP GET Request to URI

Parameters
URIThe Target URI
cookieAny previous cookie data to be used for authentication.
callbackA callback function (int hash, Hashtable headers, string payload).
Returns
Call Hashcode

Definition at line 117 of file WebPool.cs.

118  {
119  if (!_initialized) {
120  Debug.LogError ("WebPool has not finished initializing ... " +
121  "Did you call this function without having either a WebPool or ObjectPool component " +
122  "already on a MonoBehaviour?");
123  return 0;
124  }
125  GameObject go = _poolReference.Spawn (_poolID);
126  return go.GetComponent<WebPoolWorker> ().GET (URI, cookie, callback);
127  }
*< returns > Call Hashcode</returns > *int GET(string URI)
HTTP GET Request to URI
Definition: WebPool.cs:94
void Hydrogen.Core.WebPool.POST ( string  URI,
string  contentType,
string  payload 
)

HTTP POST Request to URI.

Parameters
URIThe Target URI
contentTypeThe Content-Type Header
payloadThe data to be posted.
Returns
Call Hashcode

Definition at line 136 of file WebPool.cs.

137  {
138  POST (URI, contentType, payload, null, null);
139  }
void POST(string URI, string contentType, string payload)
HTTP POST Request to URI.
Definition: WebPool.cs:136
void Hydrogen.Core.WebPool.POST ( string  URI,
string  contentType,
string  payload,
string  cookie,
System.Action< int, Hashtable, string >  callback 
)

HTTP POST Request to URI.

Parameters
URIThe Target URI
contentTypeThe Content-Type Header
payloadThe data to be posted.
cookieAny previous cookie data to be used for authentication.
callbackA callback function (int hash, Hashtable headers, string payload).
Returns
Call Hashcode

Definition at line 150 of file WebPool.cs.

151  {
152  if (!_initialized) {
153  UnityEngine.Debug.LogError ("WebPool has not finished initializing ... " +
154  "Did you call this function without having either a WebPool or ObjectPool component " +
155  "already on a MonoBehaviour?");
156  return;
157  }
158  GameObject go = _poolReference.Spawn (_poolID);
159  go.GetComponent<WebPoolWorker> ().POST (URI, contentType, payload, cookie, callback);
160  }
void POST(string URI, string contentType, string payload)
HTTP POST Request to URI.
Definition: WebPool.cs:136