Beispiel #1
0
        /// <summary>
        /// Similar to Get User but with authenticated user (token owner) as user id.
        /// <code>scope = identify</code>
        /// </summary>
        /// <param name="gameMode"><see cref="GameMode"/>. User default mode will be used if not specified.</param>
        /// <returns></returns>
        public User GetOwnData(GameMode?gameMode = null)
        {
            string route = "/me/" + gameMode?.ToParamString();
            var    json  = _httpClient.HttpGet(OsuClientV2.BaseUri + route);

            var obj = JsonConvert.DeserializeObject <User>(json);

            return(obj);
        }
Beispiel #2
0
        /// <summary>
        /// Similar to Get User but with authenticated user (token owner) as user id.
        /// <code>scope = identify</code>
        /// </summary>
        /// <param name="id">b id</param>
        /// <returns></returns>
        public Beatmap GetBeatmap(int id)
        {
            string route = $"/beatmaps/{id}";
            var    json  = _httpClient.HttpGet(OsuClientV2.BaseUri + route);

            var obj = JsonConvert.DeserializeObject <Beatmap>(json);

            return(obj);
        }
Beispiel #3
0
 /// <summary>
 /// Get clients which were created.
 /// </summary>
 public void GetClients()
 {
     string json = HttpClient.HttpGet(
         url: ClientLink,
         argsHeader: new Dictionary <string, string>
     {
         [TokenKey] = CsrfToken,
     }
         );
 }
Beispiel #4
0
 private static string GetJson(string url)
 {
     return(HttpClientUtility.HttpGet(url));
 }