예제 #1
0
        protected virtual HttpResponseMessage GetResponseFomDicionario(int position)
        {
            if (_client == null)
            {
                InitialiseClient();
            }

            string lastPartOfUri = "api/words/" + position;

            return(ASync.GetResponseMessage(_client, lastPartOfUri).Result);
        }
예제 #2
0
        public virtual string GetWordAtPosition(int position)
        {
            HttpResponseMessage response = GetResponseFomDicionario(position);

            if (response.IsSuccessStatusCode)
            {
                return(ASync.GetContentFromResponse(response).Result);
            }

            throw new NoWordAtPositionException();
        }