コード例 #1
0
ファイル: Http.cs プロジェクト: Skye347/KLib
        public override void Aborted(UniNetObject connection, object Addition)
        {
            HTTPStateObject state = Addition as HTTPStateObject;

            if (state == null)
            {
                return;
            }
            if (state.request.Done == false)
            {
                HTTPOp.Request(state.request);
            }
        }
コード例 #2
0
ファイル: Http.cs プロジェクト: Skye347/KLib
        public HTTPRequest MakeRequest(HTTPMethod?method, string Url, object Addition, HTTPRequest.RequestCallback callback, HTTPCookie cookie = null, HTTPHeader additionHeader = null, string PostData = null)
        {
            Uri path = new Uri(Url);

            if (path.Host != request.Host)
            {
                HTTPOp.Request(method.Value, Url, Addition, callback, cookie, additionHeader, PostData);
                return(null);
            }
            else
            {
                HTTPRequest newRequest = request.CopyTo();
                newRequest.method   = method == null ? newRequest.method : method.Value;
                newRequest.Url      = path.PathAndQuery;
                newRequest.Addition = Addition ?? newRequest.Addition;
                newRequest.Callback = callback ?? newRequest.Callback;
                //newRequest.Cookie = cookie ?? newRequest.Cookie ;
                newRequest.Cookie   = this.cookie?.AddCookie(cookie).GetCookie(path.Host);
                newRequest.PostData = PostData;
                //newRequest.Header = header ?? newRequest.Header ;
                return(newRequest);
            }
        }