Example #1
0
        public override IObservable <Unit> Execute()
        {
            var request = new UnityWebRequestBuilder()
            {
                Url        = _url,
                HttpMethod = _httpMethod
            }
            .AddBasicAuthHeader(AuthorizationManager.Main.Login,
                                AuthorizationManager.Main.Password);

            if (_model != null)
            {
                request.SetJsonBody(_model);
            }
            return(request.Execute().Select(_ => Unit.Default));
        }
Example #2
0
        public virtual IObservable <TResponseModel> Execute()
        {
            var request = new UnityWebRequestBuilder()
            {
                Url        = _url,
                HttpMethod = _httpMethod
            }
            .AddBasicAuthHeader(AuthorizationManager.Main.Login,
                                AuthorizationManager.Main.Password);

            if (_model != null)
            {
                request.SetJsonBody(_model);
            }
            return(request
                   .Execute()
                   .SelectModel <TResponseModel>());
        }