C# Class NG.HttpClient.HttpRequest

Basic HttpRequest abstraction. This should not be used directly. Concrete HttpRequests should inherit from this class and must declare how to construct the WWW object. After instantiating an HttpRequest class you must call the Execute method to run the request. Options: useHttps - default: false Set this to use https protocol. timeOut Set this to the number of seconds to elapse before forcing a timeout. retryAttempts - default: 0 Set this to the number of times to retry the request. delayBetweenRetries - default: 0.25f Set this to the number of seconds to elapse before a retry is attempted. Call Cancel() at any time to cancel and dispose of the request. Call GetProgress() to check on the progress of the download. HandleSuccess and HandleError have been set with defaults to report common data about an http request. These methods are virtual so they can be extended or overwritten to serve any needs.
Inheritance: IHttpRequest
显示文件 Open project: Naphier/NGTools

Public Properties

Property Type Description
delayBetweenRetries float
resultType ResultData
retryAttempts int
timeOut float
useHttps bool

Protected Properties

Property Type Description
_result HttpResult
filePath string
host string
www UnityEngine.WWW

Public Methods

Method Description
CanBeDestroyed ( ) : bool
Cancel ( ) : void
Execute ( ) : void
ExecuteCoroutine ( ) : IEnumerator
GetProgress ( ) : float
GetWWW ( ) : WWW
HandleError ( HttpResult result, WWW www ) : void
HandleSuccess ( HttpResult result, WWW www ) : void

Protected Methods

Method Description
HttpRequest ( string host, string filePath ) : System

Method Details

CanBeDestroyed() public method

public CanBeDestroyed ( ) : bool
return bool

Cancel() public method

public Cancel ( ) : void
return void

Execute() public method

public Execute ( ) : void
return void

ExecuteCoroutine() public method

public ExecuteCoroutine ( ) : IEnumerator
return IEnumerator

GetProgress() public method

public GetProgress ( ) : float
return float

GetWWW() public abstract method

public abstract GetWWW ( ) : WWW
return UnityEngine.WWW

HandleError() public method

public HandleError ( HttpResult result, WWW www ) : void
result HttpResult
www UnityEngine.WWW
return void

HandleSuccess() public method

public HandleSuccess ( HttpResult result, WWW www ) : void
result HttpResult
www UnityEngine.WWW
return void

HttpRequest() protected method

protected HttpRequest ( string host, string filePath ) : System
host string
filePath string
return System

Property Details

_result protected_oe property

protected HttpResult,NG.HttpClient _result
return HttpResult

delayBetweenRetries public_oe property

public float delayBetweenRetries
return float

filePath protected_oe property

protected string filePath
return string

host protected_oe property

protected string host
return string

resultType public_oe property

public ResultData resultType
return ResultData

retryAttempts public_oe property

public int retryAttempts
return int

timeOut public_oe property

public float timeOut
return float

useHttps public_oe property

public bool useHttps
return bool

www protected_oe property

protected WWW,UnityEngine www
return UnityEngine.WWW