Ejemplo n.º 1
0
        /// <summary>
        /// Download the profile picture of the given user as a stream
        /// </summary>
        /// <param name="id">The ID of the user</param>
        /// <returns></returns>
        public async Task <Result <Stream> > GetProfileImg(int id)
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>()
            {
                { "id", id.ToString() }
            };

            // Sends request and returns result
            HttpResponseMessage response = await _requestsClient.SendRequest(Endpoints.ProfilePicture, parameters)
                                           .ConfigureAwait(false);

            return(await ResponseParser.ParseStreamResponse(response));
        }