Represents a single http request.
Public Member Functions | |
void | CacheImage () |
Caches the image in this HTTP request. Useful for preloading images with ajax. More... | |
HttpRequest (string url, OnHttpEvent onDone) | |
Creates a new http request to the given url. More... | |
HttpRequest (string url) | |
Creates a new http request to the given URL. More... | |
void | AttachForm (WWWForm form) |
Adds the given form to this request. Note that if you wish to also use custom headers with a form, call this first. Then, add to the Headers property. More... | |
void | SetHeaders (Hashtable headers) |
Unavailable on Windows 8. Sets the headers using a hashtable set. More... | |
void | SetHeaders (Dictionary< string, string > headers) |
Sets the headers using a generic dictionary set. More... | |
void | SetPost (string toPost) |
Sets the PostData from the given UTF8 string. More... | |
void | Send () |
Sends this request. Note that this does not block. Instead, OnRequestDone will be called when it's done. More... | |
void | Remove () |
Removes this request from the active linked list. It won't be updated anymore. More... | |
void | Remove (bool waitingList) |
Removes this request from a linked list. More... | |
IEnumerator | Loader () |
The method which performs the loading of the unity WWW object. More... | |
void | Update () |
Advances this request by checking in on it's progress. More... | |
Public Attributes | |
bool | Ready |
True if the request is ready (but not necessarily complete). More... | |
string | Url |
The url that was requested. More... | |
bool | Started |
True when this request has started up. More... | |
WWW | WWWRequest |
The unity WWW object which performs the underlying request. More... | |
byte[] | PostData |
Post data to send with the request. See AttachForm. More... | |
object | ExtraData |
A custom object used for passing data to the callbacks. More... | |
Dictionary< string, string > | Headers |
The headers sent with this request. More... | |
MovieTexture | Movie |
The video being downloaded, if any. Note: Pro only. More... | |
HttpRequest | RequestAfter |
Active requests are in a linked list. The http request that follows this one. More... | |
HttpRequest | RequestBefore |
Active requests are in a linked list. The http request that is before this one. More... | |
Properties | |
bool | Errored [get] |
True if the request had an issue. PowerUI.HttpRequest.Error is the error. More... | |
bool | Ok [get] |
True if there was no issues. More... | |
string | Error [get] |
The error, if any, that occured whilst attempting to load the url. More... | |
string | Text [get] |
The response as text. Empty string if there was an error. More... | |
byte[] | Bytes [get] |
The raw bytes of the response. Null if there was an error. More... | |
MovieTexture | Video [get] |
The response as a video. Null if there was an error. More... | |
Texture2D | Image [get] |
The response as an image. Null if there was an error. More... | |
float | Progress [get] |
The current download progress. More... | |
Events | |
OnHttpEvent | OnRequestDone |
An event called when the request is completely finished. More... | |
OnHttpEvent | OnRequestReady |
An event called when the data is ready for use (e.g. videos). More... | |
Private Member Functions | |
Dictionary< string, string > | ToDictionary (Hashtable headers) |
Converts a hashtable to a dictionary. More... | |
Private Attributes | |
IEnumerator | LoadingEnumerator |
The enumerator which processes the unity WWW object. More... | |
|
inline |
Creates a new http request to the given url.
url | The url to request. |
onDone | A method to call with the result. |
|
inline |
Creates a new http request to the given URL.
url | The url to request. |
|
inline |
Adds the given form to this request. Note that if you wish to also use custom headers with a form, call this first. Then, add to the Headers property.
form | The form to attach to this request. |
|
inline |
Caches the image in this HTTP request. Useful for preloading images with ajax.
|
inline |
The method which performs the loading of the unity WWW object.
|
inline |
Removes this request from the active linked list. It won't be updated anymore.
|
inline |
Removes this request from a linked list.
waitingList | True if it should be removed from the waiting queue; false for the active queue. |
|
inline |
Sends this request. Note that this does not block. Instead, OnRequestDone will be called when it's done.
|
inline |
Unavailable on Windows 8. Sets the headers using a hashtable set.
headers | The headers to set. |
|
inline |
Sets the headers using a generic dictionary set.
headers | The headers to set. |
|
inline |
Sets the PostData from the given UTF8 string.
toPost | The string to POST. |
|
inlineprivate |
Converts a hashtable to a dictionary.
|
inline |
Advances this request by checking in on it's progress.
object UnityHttp.HttpRequest.ExtraData |
A custom object used for passing data to the callbacks.
Dictionary<string,string> UnityHttp.HttpRequest.Headers |
The headers sent with this request.
|
private |
The enumerator which processes the unity WWW object.
MovieTexture UnityHttp.HttpRequest.Movie |
The video being downloaded, if any. Note: Pro only.
byte [] UnityHttp.HttpRequest.PostData |
Post data to send with the request. See AttachForm.
bool UnityHttp.HttpRequest.Ready |
True if the request is ready (but not necessarily complete).
HttpRequest UnityHttp.HttpRequest.RequestAfter |
Active requests are in a linked list. The http request that follows this one.
HttpRequest UnityHttp.HttpRequest.RequestBefore |
Active requests are in a linked list. The http request that is before this one.
bool UnityHttp.HttpRequest.Started |
True when this request has started up.
string UnityHttp.HttpRequest.Url |
The url that was requested.
WWW UnityHttp.HttpRequest.WWWRequest |
The unity WWW object which performs the underlying request.
|
get |
The raw bytes of the response. Null if there was an error.
|
get |
The error, if any, that occured whilst attempting to load the url.
|
get |
True if the request had an issue. PowerUI.HttpRequest.Error is the error.
|
get |
The response as an image. Null if there was an error.
|
get |
True if there was no issues.
|
get |
The current download progress.
|
get |
The response as text. Empty string if there was an error.
|
get |
The response as a video. Null if there was an error.
OnHttpEvent UnityHttp.HttpRequest.OnRequestDone |
An event called when the request is completely finished.
OnHttpEvent UnityHttp.HttpRequest.OnRequestReady |
An event called when the data is ready for use (e.g. videos).