KS.Reactor.ksWebRequest Class Reference

Asynchronous web request class using HTTP Web Request. More...

Inheritance diagram for KS.Reactor.ksWebRequest:
KS.Reactor.ksIWebRequest

Public Member Functions

delegate void OnCompleteCallback (ksWebResponse response)
 Callback for completed web requests. More...
 
 ksWebRequest (string url, WebHeaderCollection headers=null, string method="GET", ksJSON jsonRequest=null, ksWebResponse.Handler onComplete=null, object stateObject=null)
 Constructor specific requests. More...
 
 ksWebRequest (string url, FileInfo[] files, ksJSON jsonRequest, ksWebResponse.Handler onComplete=null)
 Sends a request and upload files. More...
 

Properties

string Method [get]
 Method. More...
 
string URL [get]
 URL. More...
 
ksJSON JSON [get]
 JSON data. More...
 
WebHeaderCollection? Headers [get]
 Headers. More...
 
bool IsDone [get]
 Checks if the request has completed. More...
 
ksWebResponse Response [get]
 Response. More...
 
- Properties inherited from KS.Reactor.ksIWebRequest
string Method [get]
 Method. More...
 
string URL [get]
 URL. More...
 
ksJSON JSON [get]
 JSON request data. More...
 
WebHeaderCollection Headers [get]
 Headers. More...
 
bool IsDone [get]
 Check if the request has completed. More...
 
ksWebResponse Response [get]
 Response. More...
 

Detailed Description

Asynchronous web request class using HTTP Web Request.

Constructor & Destructor Documentation

◆ ksWebRequest() [1/2]

KS.Reactor.ksWebRequest.ksWebRequest ( string  url,
WebHeaderCollection  headers = null,
string  method = "GET",
ksJSON  jsonRequest = null,
ksWebResponse.Handler  onComplete = null,
object  stateObject = null 
)

Constructor specific requests.

Parameters
urlURL.
headersRequest string.
methodRequest method.
jsonRequestJSON request.
onCompleteOptional completion handler.
stateObjectUser defined state tracking object.

◆ ksWebRequest() [2/2]

KS.Reactor.ksWebRequest.ksWebRequest ( string  url,
FileInfo[]  files,
ksJSON  jsonRequest,
ksWebResponse.Handler  onComplete = null 
)

Sends a request and upload files.

Parameters
urlURL
filesList of files to upload.
jsonRequestJSON request data.
onCompleteOptional completion handler.

Member Function Documentation

◆ OnCompleteCallback()

delegate void KS.Reactor.ksWebRequest.OnCompleteCallback ( ksWebResponse  response)

Callback for completed web requests.

Parameters
responseCompleted web request.

Property Documentation

◆ Headers

WebHeaderCollection? KS.Reactor.ksWebRequest.Headers
get

Headers.

◆ IsDone

bool KS.Reactor.ksWebRequest.IsDone
get

Checks if the request has completed.

◆ JSON

ksJSON KS.Reactor.ksWebRequest.JSON
get

JSON data.

◆ Method

string KS.Reactor.ksWebRequest.Method
get

Method.

◆ Response

ksWebResponse KS.Reactor.ksWebRequest.Response
get

Response.

◆ URL

string KS.Reactor.ksWebRequest.URL
get

URL.