C# 클래스 IBM.Cloudant.Client.CookieInterceptor

Adds cookie authentication support to http requests. It does this by adding the cookie header for CouchDB using request interceptor pipeline in IBM.Cloudant.Client.HttpHelper. If a response has a response code of 401, it will fetch a cookie from the server using provided credentials and tell IBM.Cloudant.Client.HttpHelper to reply the request by setting IBM.Cloudant.Client.HttpConnectionInterceptorContext.replayRequest property to true. If the request to get the cookie for use in future request fails with a 401 status code (or any status that indicates client error) cookie authentication will not be attempted again.
This class is used for adding cookie authentication to HTTP requests.
상속: IHttpConnectionRequestInterceptor, IHttpConnectionResponseInterceptor
파일 보기 프로젝트 열기: cloudant/xamarin-cloudant 1 사용 예제들

공개 메소드들

메소드 설명
CookieInterceptor ( string username, string password ) : System

Initializes a new instance of the IBM.Cloudant.Client.CookieInterceptor class.

InterceptRequest ( HttpConnectionInterceptorContext context ) : HttpConnectionInterceptorContext

Intercepts the HttpRequest before it is sent.

InterceptResponse ( HttpConnectionInterceptorContext context ) : HttpConnectionInterceptorContext

Intercepts the HttpResponse before it is consumed.

비공개 메소드들

메소드 설명
GetCookie ( Uri uri ) : string
SessionHasStarted ( HttpContent content ) : System.Boolean

메소드 상세

CookieInterceptor() 공개 메소드

Initializes a new instance of the IBM.Cloudant.Client.CookieInterceptor class.
public CookieInterceptor ( string username, string password ) : System
username string The username to use when getting the cookie
password string The password to use when getting the cookie
리턴 System

InterceptRequest() 공개 메소드

Intercepts the HttpRequest before it is sent.
public InterceptRequest ( HttpConnectionInterceptorContext context ) : HttpConnectionInterceptorContext
context HttpConnectionInterceptorContext Http connection interceptor context with the current state.
리턴 HttpConnectionInterceptorContext

InterceptResponse() 공개 메소드

Intercepts the HttpResponse before it is consumed.
public InterceptResponse ( HttpConnectionInterceptorContext context ) : HttpConnectionInterceptorContext
context HttpConnectionInterceptorContext Http connection interceptor context with the current state
리턴 HttpConnectionInterceptorContext