コード例 #1
0
        public void Create()
        {
            JamaOptions options = JamaOptionsFactory.Create();

            Assert.IsNotNull(options);
            Assert.IsTrue(options.BaseUrl.IsAbsoluteUri);
            Assert.IsFalse(string.IsNullOrWhiteSpace(options.Username));
            Assert.IsFalse(string.IsNullOrWhiteSpace(options.Password));
        }
コード例 #2
0
        public static IRestClient Create(JamaOptions jamaOptions, JsonSerializerOptions serializerOptions)
        {
            var client = new RestClient(jamaOptions.BaseUrl)
            {
                Authenticator = new HttpBasicAuthenticator(jamaOptions.Username, jamaOptions.Password)
            };

            return(client.UseSystemTextJson(serializerOptions));
        }