public IRestResponse Execute(IRestRequest request) { AuthenticateIfNeeded(request); var http = _httpFactory.Create(); var httpResponse = http.GetResponse(request); return(ToRestReponse(httpResponse)); }
public static Task <HttpWebResponse> GetResponse(Uri uri, string requestMethod) { var request = Factory.Create(uri); request.Method = "HEAD"; return(Factory.GetValidResponse(request)); }
private IRestResponse Execute(IRestRequest request, string httpMethod, Func <IHttp, string, HttpResponse> getResponse) { AuthenticateIfNeeded(this, request); IRestResponse restResponse = new RestResponse(); try { IHttp http = HttpFactory.Create(); ConfigureHttp(request, http); restResponse = ConvertToRestResponse(request, getResponse(http, httpMethod)); restResponse.Request = request; restResponse.Request.IncreaseNumAttempts(); } catch (Exception ex) { restResponse.ResponseStatus = ResponseStatus.Error; restResponse.ErrorMessage = ex.Message; restResponse.ErrorException = ex; } return(restResponse); }
public LinkService(IHttpFactory httpFactory, IThingMapper thingMapper) { m_thingMapper = thingMapper; m_client = httpFactory.Create(); }
public SubredditService(IHttpFactory httpFactory, IThingMapper thingMapper) { m_httpClient = httpFactory.Create(); m_thingMapper = thingMapper; }
public CommentsService(IHttpFactory httpFactory, IThingMapper thingMapper) { m_thingMapper = thingMapper; m_httpClient = httpFactory.Create(); }
public static HttpWebRequest CreateRequest(Uri uri) { return(httpFactory.Create(uri)); }