Пример #1
0
        private IRestRequest CreateRestRequestWithFile(IYouTrackFileRequest request, Method method)
        {
            IRestRequest restRequest = CreateRestRequest(request, method);

            AddFileToRestRequest(request, restRequest);

            return(restRequest);
        }
Пример #2
0
        private IRestResponse ExecuteRequestWithFile(IYouTrackFileRequest request, Method method)
        {
            IRestRequest  restRequest  = CreateRestRequestWithFile(request, method);
            IRestResponse restResponse = restClient.Execute(restRequest);

            ThrowIfRequestFailed(restResponse);

            return(restResponse);
        }
        public IRestRequest CreateRestRequestWithFile(IYouTrackFileRequest request, ISession session, Method method)
        {
            IRestRequest restRequest = CreateRestRequest(request, session, method);
            AddFileToRestRequest(request, restRequest);

            //Using Accept=application/xml for files doesn't work in 5.x http://youtrack.jetbrains.com/issue/JT-25271
            ReplaceAcceptWithJson(restRequest);

            return restRequest;
        }
 private void AddFileToRestRequest(IYouTrackFileRequest request, IRestRequest restRequest)
 {
     if (request.HasBytes)
     {
         restRequest.AddFile(request.Name, request.Bytes, request.FileName);
     }
     else
     {
         restRequest.AddFile(request.Name, request.FilePath);
     }
 }
Пример #5
0
 private void AddFileToRestRequest(IYouTrackFileRequest request, IRestRequest restRequest)
 {
     if (request.HasBytes)
     {
         restRequest.AddFile(request.Name, request.Bytes, request.FileName);
     }
     else
     {
         restRequest.AddFile(request.Name, request.FilePath);
     }
 }
        public IRestRequest CreateRestRequestWithFile(IYouTrackFileRequest request, ISession session, Method method)
        {
            IRestRequest restRequest = CreateRestRequest(request, session, method);

            AddFileToRestRequest(request, restRequest);

            //Using Accept=application/xml for files doesn't work in 5.x http://youtrack.jetbrains.com/issue/JT-25271
            ReplaceAcceptWithJson(restRequest);

            return(restRequest);
        }
Пример #7
0
 public IRestRequest CreateRestRequestWithFile(IYouTrackFileRequest request, ISession session, Method method)
 {
     return(restFileRequestFactory.CreateRestRequestWithFile(request, session, method));
 }
Пример #8
0
        private IRestResponse ExecuteRequestWithAuthenticationAndFile(IYouTrackFileRequest request, Method method)
        {
            LoginIfNotAuthenticated();

            return(ExecuteRequestWithFile(request, method));
        }
 public IRestRequest CreateRestRequestWithFile(IYouTrackFileRequest request, ISession session, Method method)
 {
     return restFileRequestFactory.CreateRestRequestWithFile(request, session, method);
 }