/// <summary> /// The HTTP client used for requests. /// </summary> /// <param name="client"></param> /// <returns></returns> public Builder SetClient(HttpImplement client) { if (client == null) { throw new ArgumentException("Client may not be null."); } httpImpl = client; return(this); }
public void Awake() { methodInfoCache.Clear(); convert = new DefalutConvert(); httpImpl = SetHttpImpl(); interceptor = SetIntercepter(); rxSupport = new RxSupport(convert, httpImpl, interceptor); SetRestAPI(); StartCoroutine(GenMethodCache()); }
public void Init(bool enableLog, string baseUrl, HttpImplement httpImpl, RequestInterceptor requestInterceptor, Converter.Converter converter, ErrorHandler errorHandler) { methodInfoCache.Clear(); this.enableDebug = enableLog; this.baseUrl = baseUrl; this.httpImpl = httpImpl; this.interceptor = requestInterceptor; this.convert = converter; this.errorHandler = errorHandler; this.rxSupport = new RxSupport(convert, httpImpl, interceptor); }
private void EnsureSaneDefaults() { if (converter == null) { converter = new DefalutConvert(); } if (httpImpl == null) { httpImpl = new HttpClientImpl(); } if (errorHandler == null) { errorHandler = new DefaultErrorHandler(); } if (requestInterceptor == null) { requestInterceptor = new DefaultRequestInterceptor(); } }
public RxSupport(Converter.Converter convert, HttpImplement httpImpl, RequestInterceptor interceptor) { this.convert = convert; this.rxHttpImpl = httpImpl as RxHttpImplement; this.interceptor = interceptor; }