コード例 #1
0
        public ResponseMessage(string errorMessage, RequestData requestData = null)
        {
            IsSuccessStatusCode = false;

            ErrorMessage = errorMessage;

            Request = requestData;
        }
コード例 #2
0
        public ResponseMessage(byte[] message, RequestData requestData = null, bool isSuccessStatusCode = true)
        {
            Content = new ResponseContent(message);

            IsSuccessStatusCode = isSuccessStatusCode;

            Request = requestData;
        }
コード例 #3
0
		public async Task<ResponseMessage> GetAsync(string url, string tag = null)
		{
			RequestData requestData = new RequestData
			{
				Tag = tag,
				Url = url,
				Type = RequestData.RequestType.Get,
				Timeout = Timeout <= new TimeSpan(0, 0, 0) ? _defaultTimeout : Timeout
			};

			using (var scope = IoCService.Container.BeginLifetimeScope())
			{
				return await scope.Resolve<IHttpService>().GetResponse(requestData);
			}
		}