public VisibleRequest(object request, string resource, VisibleConfig visibleConfiguration, Method method = Method.POST)
        {
            visibleClient = new Client(visibleConfiguration);

            restRequest = new RestRequest(resource, method);
            restRequest.AddHeader("Accept", "application/json");
            restRequest.AddHeader("content_type", "application/json");
            restRequest.AddJsonBody(request);
        }
Exemple #2
0
        internal Client(VisibleConfig visibleConfiguration)
        {
            ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

            if (visibleConfiguration == null)
            {
                throw new ArgumentNullException("visibleConfiguration");
            }
            configuration = visibleConfiguration;

            client = new RestClient(visibleConfiguration.ApiURL);

            Assembly        assembly = Assembly.GetExecutingAssembly();
            FileVersionInfo info     = FileVersionInfo.GetVersionInfo(assembly.Location);

            version = info.FileVersion;
        }