Beispiel #1
0
        /// <summary>
        ///     コンストラクタ
        /// </summary>
        /// <param name="clientId">Client ID (ライブラリには含まれまていません)</param>
        /// <param name="clientSecret">Client Secret (ライブラリには含まれていません)</param>
        public PixivClient(string clientId, string clientSecret)
        {
            ClientId     = clientId;
            ClientSecret = clientSecret;

            // 2018/03/30
            _httpClient = new HttpClient();
            _httpClient.DefaultRequestHeaders.Add("App-OS-Version", OsVersion);
            _httpClient.DefaultRequestHeaders.Add("App-OS", "ios");
            _httpClient.DefaultRequestHeaders.Add("App-Version", AppVersion);
            _httpClient.DefaultRequestHeaders.Add("User-Agent", $"PixivIOSApp/{AppVersion} (iOS {OsVersion}; iPhone9,2)");

            // Initialize accesors
            Application    = new ApplicationInfoClient(this);
            Authentication = new AuthenticationClient(this);
            Illust         = new IllustClient(this);
            IllustSeries   = new IllustSeriesClient(this);
            Live           = new LiveClient(this);
            Manga          = new MangaClient(this);
            Mute           = new MuteClient(this);
            Notification   = new NotificationClient(this);
            Novel          = new NovelClient(this);
            Search         = new SearchClient(this);
            Spotlight      = new SpotlightClient(this);
            TrendingTags   = new TrendingTagsClient(this);
            User           = new UserClient(this);
            Walkthrough    = new WalkthroughClient(this);
            File           = new FileClient(this);
        }
Beispiel #2
0
 /// <inheritdoc />
 internal BrowsingHistoryClient(PixivClient pixivClient) : base(pixivClient)
 {
     Illust = new IllustClient(pixivClient);
     Novel  = new NovelClient(pixivClient);
 }