NuxeoClient.Client.Client C# (CSharp) Method

Client() public method

Initializes a new instance of the Nuxeo Client.
public Client ( string serverURL = "http://localhost:8080/nuxeo/", Authorization authorization = null, string automationPath = "api/v1/automation/", string restPath = "api/v1/", string schemas = null, int timeout = 30 ) : Newtonsoft.Json
serverURL string The URL of the Nuxeo server.
authorization Authorization The authorization credentials.
automationPath string The Automation API path.
restPath string The REST API path.
schemas string The default schemas to be used in the requests.
timeout int The default request timeout.
return Newtonsoft.Json
        public Client(string serverURL = "http://localhost:8080/nuxeo/",
                      Authorization authorization = null,
                      string automationPath = "api/v1/automation/",
                      string restPath = "api/v1/",
                      string[] schemas = null,
                      int timeout = 30)
        {
            http = new HttpClient(new HttpClientHandler()
            {
                AutomaticDecompression = System.Net.DecompressionMethods.None,
                AllowAutoRedirect = false
            });
            SetTimemout(timeout);
            SetServerURL(serverURL);
            SetAuthorization(authorization);
            SetAuthomationPath(automationPath);
            SetRestPath(restPath);
            SetAuthorization(authorization);
            http.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(ContentType.ALL));
            Marshaller = new Marshaller(this).RegisterEntity("workflow", typeof(Workflow))
                                             .RegisterEntity("worflows", typeof(Workflows))
                                             .RegisterEntity("task", typeof(NuxeoClient.Wrappers.Task))
                                             .RegisterEntity("tasks", typeof(Tasks));
        }