/// <summary>
        /// Sends a web request and received a response object that can be yielded.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <XUnityWebResponse> SendAsync(XUnityWebRequest request)
        {
            var response = new XUnityWebResponse();

            _requestCookies = request.Cookies;
            _requestHeaders = request.Headers;

            if (request.Data == null)
            {
                Exception error  = null;
                string    result = null;
                try
                {
                    result = await this.DownloadStringTaskAsync(request.Address);
                }
                catch (Exception e)
                {
                    error = e;
                }

                response.SetCompleted(_responseCode.Value, result, ResponseHeaders, _responseCookies, error);
            }
            else
            {
                Exception error  = null;
                string    result = null;
                try
                {
                    result = await this.UploadStringTaskAsync(request.Address, request.Method, request.Data);
                }
                catch (Exception e)
                {
                    error = e;
                }

                response.SetCompleted(_responseCode.Value, result, ResponseHeaders, _responseCookies, error);
            }

            return(response);
        }
 void IHttpRequestCreationContext.Complete(XUnityWebRequest request)
 {
     Request = request;
 }