Was this page helpful?

Plug Class

    Table of contents
    1. 1. Members
      1. 1.1. Constructors
      2. 1.2. Fields
      3. 1.3. Properties
      4. 1.4. Methods
    Table of Contents
    public class Plug
    Namespace: MindTouch.Dream
    Assembly: mindtouch.dream
    Type Hierarchy:
    • object
      • Plug
    Provides a fluent, immutable interface for building request/response invocation against a resource. Mostly used as an interface for making Http requests, but can be extended for any resource that can provide request/response semantics.

    Members

    Fields

    Visibility Description
    Public Uri Uri of the instance.
    Public Timeout Timeout for invocation.
    Public Credentials If not null, the creditials to use for the invocation.
    Public DEFAULT_TIMEOUT Default timeout of 60 seconds for MindTouch.Dream.Plug invocations.
    Public GlobalCookies Default, shared cookie jar for all plugs.

    Properties

    Visibility Description
    Public Headers Request header collection.
    Public PreHandlers Pre-invocation handlers.
    Public PostHandlers Post-invocation handlers.
    Public CookieJar Cookie jar for the request.

    Methods

    Visibility Description
    Public OptionsAsync() This method is deprecated. Please use Plug.Options(Result<DreamMessage> result) instead.
    Public DeleteAsync() This method is deprecated. Please use Plug.Delete(Result<DreamMessage> result) instead.
    Public DeleteAsync(XDoc doc) This method is deprecated. Please use Plug.Delete(XDoc doc, Result<DreamMessage> result) instead.
    Public DeleteAsync(DreamMessage message) This method is deprecated. Please use Plug.Delete(DreamMessage message, Result<DreamMessage> result) instead.
    Public InvokeAsync(string verb, DreamMessage request) This method is deprecated. Please use Plug.Invoke(string verb, DreamMessage request, Result<DreamMessage> result) instead.
    Public New(string uri) Create a new MindTouch.Dream.Plug instance from a uri string.
    Public New(string uri, TimeSpan timeout) Create a new MindTouch.Dream.Plug instance from a uri string.
    Public New(Uri uri) Create a new MindTouch.Dream.Plug instance from a Plug.Uri.
    Public New(Uri uri, TimeSpan timeout) Create a new MindTouch.Dream.Plug instance from a Plug.Uri.
    Public New(XUri uri) Create a new MindTouch.Dream.Plug instance from a MindTouch.Dream.XUri.
    Public New(XUri uri, TimeSpan timeout) Create a new MindTouch.Dream.Plug instance from a MindTouch.Dream.XUri.
    Public AddEndpoint(IPlugEndpoint endpoint) Manually add a plug endpoint for handling invocations.
    Public RemoveEndpoint(IPlugEndpoint endpoint) Manually remove a plug endpoint from the handler pool.
    Public WaitAndConfirm(Result<DreamMessage> result) Blocks on a Plug synchronization handle to wait for it ti complete and confirm that it's a non-error response.
    Public At(params String[] segments) Create a copy of the instance with new path segments appended to its Uri.
    Public AtPath(string path) Create a copy of the instance with a path/query/fragement appended to its Uri.
    Public With(string key, string value) Create a copy of the instance with a query key/value pair added.
    Public With(string key, bool value) Create a copy of the instance with a query key/value pair added.
    Public With(string key, int value) Create a copy of the instance with a query key/value pair added.
    Public With(string key, long value) Create a copy of the instance with a query key/value pair added.
    Public With(string key, decimal value) Create a copy of the instance with a query key/value pair added.
    Public With(string key, double value) Create a copy of the instance with a query key/value pair added.
    Public With(string key, DateTime value) Create a copy of the instance with a query key/value pair added.
    Public WithParams(KeyValuePair`2[] args)
    Public WithQuery(string query) Create a copy of the instance with the provided querystring added.
    Public WithParamsFrom(XUri uri) Create a copy of the instance with parameters from another uri added.
    Public WithCredentials(string user, string password) Create a copy of the instance with the given credentials
    Public WithCredentials(ICredentials credentials) Create a copy of the instance with the given credentials
    Public WithoutCredentials() Create a copy of the instance with credentials removed.
    Public WithCookieJar(DreamCookieJar cookieJar) Create a copy of the instance with an override cookie jar.
    Public WithoutCookieJar() Create a copy of the instance with any override cookie jar removed.
    Public WithHeader(string name, string value) Create a copy of the instance with a header added.
    Public WithHeaders(DreamHeaders headers) Create a copy of the instance with a header collection added.
    Public WithoutHeader(string name) Create a copy of the instance with a header removed.
    Public WithoutHeaders() Create a copy of the instance with all headers removed.
    Public WithPreHandler(params PlugHandler[] preHandlers) Create a copy of the instance with a pre-invocation handler added.
    Public WithPostHandler(params PlugHandler[] postHandlers) Create a copy of the instance with a post-invocation handler added.
    Public WithoutHandlers() Create a copy of the instance with all handlers removed.
    Public WithTimeout(TimeSpan timeout) Create a copy of the instance with a new timeout.
    Public ToString() (Override) Provide a string representation of the Uri of the instance.
    Public Post() Blocking version of Plug.Post(Result<DreamMessage> result)
    Public Post(XDoc doc) Blocking version of Plug.Post(XDoc doc, Result<DreamMessage> result)
    Public Post(DreamMessage message) Blocking version of Plug.Post(DreamMessage message, Result<DreamMessage> result)
    Public PostAsForm() Blocking version of Plug.PostAsForm(Result<DreamMessage> result)
    Public Put(XDoc doc) Blocking version of Plug.Put(XDoc doc, Result<DreamMessage> result)
    Public Put(DreamMessage message) Blocking version of Plug.Put(DreamMessage message, Result<DreamMessage> result)
    Public Get() Blocking version of Plug.Get(Result<DreamMessage> result)
    Public Get(DreamMessage message) Blocking version of Plug.Get(DreamMessage message, Result<DreamMessage> result)
    Public Head() Blocking version of Plug.Head(Result<DreamMessage> result)
    Public Options() Blocking version of Plug.Options(Result<DreamMessage> result)
    Public Delete() Blocking version of Plug.Delete(Result<DreamMessage> result)
    Public Delete(XDoc doc) Blocking version of Plug.Delete(XDoc doc, Result<DreamMessage> result)
    Public Delete(DreamMessage message) Blocking version of Plug.Delete(DreamMessage message, Result<DreamMessage> result)
    Public Invoke(string verb, DreamMessage message) Blocking version of Plug.Invoke(string verb, DreamMessage request, Result<DreamMessage> result)
    Public Post(Result<DreamMessage> result) Invoke the plug with the Verb.POST verb and an empty message.
    Public Post(XDoc doc, Result<DreamMessage> result) Invoke the plug with the Verb.POST verb.
    Public Post(DreamMessage message, Result<DreamMessage> result) Invoke the plug with the Verb.POST verb.
    Public PostAsForm(Result<DreamMessage> result) Invoke the plug with the Verb.POST verb with Verb.GET query arguments converted as form post body.
    Public Put(XDoc doc, Result<DreamMessage> result) Invoke the plug with the Verb.PUT verb.
    Public Put(DreamMessage message, Result<DreamMessage> result) Invoke the plug with the Verb.PUT verb.
    Public Get(Result<DreamMessage> result) Invoke the plug with the Verb.GET verb and no message body.
    Public Get(DreamMessage message, Result<DreamMessage> result) Invoke the plug with the Verb.GET verb.
    Public Head(Result<DreamMessage> result) Invoke the plug with the Verb.HEAD verb and no message body.
    Public Options(Result<DreamMessage> result) Invoke the plug with the Verb.OPTIONS verb and no message body.
    Public Delete(Result<DreamMessage> result) Invoke the plug with the Verb.DELETE verb and no message body.
    Public Delete(XDoc doc, Result<DreamMessage> result) Invoke the plug with the Verb.DELETE verb.
    Public Delete(DreamMessage message, Result<DreamMessage> result) Invoke the plug with the Verb.DELETE verb.
    Public Invoke(string verb, DreamMessage request, Result<DreamMessage> result) Invoke the plug.
    Public InvokeEx(string verb, DreamMessage request, Result<DreamMessage> result) Invoke the plug, but leave the stream unread so that the returned MindTouch.Dream.DreamMessage can be streamed.
    Public WithParams(NameValueCollection args) This method is deprecated. Please use M:MindTouch.Dream.Plug.WithParams(System.Collections.Generic.KeyValuePair{System.String,System.String}[]) instead.
    Public WithHeaders(NameValueCollection headers) This method is deprecated. Please use Plug.WithHeaders(DreamHeaders headers) instead.
    Public PostAsync() This method is deprecated. Please use Plug.Post(Result<DreamMessage> result) instead.
    Public PostAsync(XDoc doc) This method is deprecated. Please use Plug.Post(XDoc doc, Result<DreamMessage> result) instead.
    Public PostAsync(DreamMessage message) This method is deprecated. Please use Plug.Post(DreamMessage message, Result<DreamMessage> result) instead.
    Public PostAsFormAsync() This method is deprecated. Please use Plug.PostAsForm(Result<DreamMessage> result) instead.
    Public PutAsync(XDoc doc) This method is deprecated. Please use Plug.Put(XDoc doc, Result<DreamMessage> result) instead.
    Public PutAsync(DreamMessage message) This method is deprecated. Please use Plug.Put(DreamMessage message, Result<DreamMessage> result) instead.
    Public GetAsync() This method is deprecated. Please use Plug.Get(Result<DreamMessage> result) instead.
    Public GetAsync(DreamMessage message) This method is deprecated. Please use Plug.Get(DreamMessage message, Result<DreamMessage> result) instead.
    Public HeadAsync() This method is deprecated. Please use Plug.Head(Result<DreamMessage> result) instead.
    Public Equals(object obj) (Inherited from Object)
    Public GetHashCode() (Inherited from Object)
    Public GetType() (Inherited from Object)
    Protected MemberwiseClone() (Inherited from Object)
    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by