C# Class SnooNotesAPI.Utilities.SNWebAgent

Inheritance: IWebAgent
显示文件 Open project: CrustyJew/SnooNotes Class Usage Examples

Public Methods

Method Description
CreateAndExecuteRequest ( string url ) : JToken
CreateGet ( string url ) : HttpWebRequest
CreatePost ( string url ) : HttpWebRequest
CreateRequest ( string url, string method ) : HttpWebRequest
ExecuteRequest ( HttpWebRequest request ) : JToken

Executes the web request and handles errors in the response

GetResponseString ( Stream stream ) : string
SNWebAgent ( ) : System
SNWebAgent ( string accessToken ) : System
WritePostBody ( Stream stream, object data ) : void

Private Methods

Method Description
CreateGet ( Uri url ) : HttpWebRequest
CreateRequest ( Uri uri, string method ) : HttpWebRequest
EnforceRateLimit ( ) : void

Method Details

CreateAndExecuteRequest() public method

public CreateAndExecuteRequest ( string url ) : JToken
url string
return JToken

CreateGet() public method

public CreateGet ( string url ) : HttpWebRequest
url string
return System.Net.HttpWebRequest

CreatePost() public method

public CreatePost ( string url ) : HttpWebRequest
url string
return System.Net.HttpWebRequest

CreateRequest() public method

public CreateRequest ( string url, string method ) : HttpWebRequest
url string
method string
return System.Net.HttpWebRequest

ExecuteRequest() public method

Executes the web request and handles errors in the response
public ExecuteRequest ( HttpWebRequest request ) : JToken
request System.Net.HttpWebRequest
return JToken

GetResponseString() public method

public GetResponseString ( Stream stream ) : string
stream Stream
return string

SNWebAgent() public method

public SNWebAgent ( ) : System
return System

SNWebAgent() public method

public SNWebAgent ( string accessToken ) : System
accessToken string
return System

WritePostBody() public method

public WritePostBody ( Stream stream, object data ) : void
stream Stream
data object
return void