C# 클래스 NUnit.Extensions.Asp.HttpClient

A web client, capable of communicating with a web server.
파일 보기 프로젝트 열기: vcsjones/NUnitAsp 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
Credentials ICredentials
Default HttpClient
Proxy IWebProxy
UrlReferrer System.Uri
UserAgent string
UserLanguages string[]

Private Properties

프로퍼티 타입 설명
AddUserLanguageHeaders void
CreateRequest System.Net.HttpWebRequest
DoWebRequest void
GetRedirectUrl string
GetUrlFromResponse System.Uri
ParseStackTrace string
ReadHttpResponse void
SendRequest System.Net.HttpWebResponse
SubmitForm void
TrackUrlReferrer void
TrimFragmentIdentifier string
UpdateCredentialsFromUrl void
UpdateCurrentUrl void
WriteRequestBody void

공개 메소드들

메소드 설명
CookieValue ( string cookieName ) : string

Returns the value of a cookie. Throws exception if the cookie hasn't been set.

FollowLink ( string url ) : void

Retrieves a page from a web server. Different from GetPage in that it sets the current page as the referrer. You should use normally use GetPage.

GetPage ( string url ) : void

Retrieves a page from a web server.

HasCookie ( string cookieName ) : bool

Checks to see if a cookie has been set.

비공개 메소드들

메소드 설명
AddUserLanguageHeaders ( HttpWebRequest request ) : void
CreateRequest ( string method, string formVariables ) : HttpWebRequest
DoWebRequest ( string url, string method, string formVariables ) : void
GetRedirectUrl ( HttpWebResponse response ) : string
GetUrlFromResponse ( HttpWebResponse response ) : Uri
ParseStackTrace ( string aspExceptionPageHtml ) : string

Returns null if stack trace couldn't be found.

ReadHttpResponse ( HttpWebResponse response ) : void
SendRequest ( HttpWebRequest request ) : HttpWebResponse
SubmitForm ( WebFormTester form ) : void
TrackUrlReferrer ( ) : void
TrimFragmentIdentifier ( string url ) : string
UpdateCredentialsFromUrl ( ) : void
UpdateCurrentUrl ( string url, bool isGet, string formVariables ) : void
WriteRequestBody ( HttpWebRequest request, string formVariables ) : void

메소드 상세

CookieValue() 공개 메소드

Returns the value of a cookie. Throws exception if the cookie hasn't been set.
public CookieValue ( string cookieName ) : string
cookieName string
리턴 string

FollowLink() 공개 메소드

Retrieves a page from a web server. Different from GetPage in that it sets the current page as the referrer. You should use normally use GetPage.
public FollowLink ( string url ) : void
url string
리턴 void

GetPage() 공개 메소드

Retrieves a page from a web server.
public GetPage ( string url ) : void
url string The URL of the page to get.
리턴 void

HasCookie() 공개 메소드

Checks to see if a cookie has been set.
public HasCookie ( string cookieName ) : bool
cookieName string The name of the cookie.
리턴 bool

프로퍼티 상세

Credentials 공개적으로 프로퍼티

Username and password (null if none). Set automatically if the username and password are supplied in the URL (i.e., "http://username:password@host"). Can be used with both "basic" and "Windows Integrated" (NTLM) authentication methods. Set this property to CredentialCache.DefaultCredentials to use your current Windows login.
public ICredentials Credentials
리턴 ICredentials

Default 공개적으로 정적으로 프로퍼티

The HttpClient that's used by default in all tests.

If you're creating a custom tester, don't use this property! Use ControlTester.ControlTester.Browser instead.

public static HttpClient,NUnit.Extensions.Asp Default
리턴 HttpClient

Proxy 공개적으로 프로퍼티

The proxy server information to use to proxy HTTP requests. If this property is set to null, the default value returned by GlobalProxySelection.Select is used.
public IWebProxy Proxy
리턴 IWebProxy

UrlReferrer 공개적으로 프로퍼티

URL containing the hyperlink or form that caused the browser to load the current url (null if none). Fragments aren't included (the part of the URL that comes after a '#').
public Uri,System UrlReferrer
리턴 System.Uri

UserAgent 공개적으로 프로퍼티

The user-agent string to send to the server. Useful if you want to pretend to be a specific browser. Defaults to IE_USER_AGENT.

Be careful when changing this, as ASP.NET renders controls differently for different user agents. NUnitAsp's testers may not be able to recognize a control that was rendered for a different browser.

public string UserAgent
리턴 string

UserLanguages 공개적으로 프로퍼티

The language-tag elements to send to the server (null if none). These appear in the Request.UserLanguages array in the target page.
public string[] UserLanguages
리턴 string[]