예제 #1
0
        public override WebResponse GetResponse()
        {
            SerializationInfo   si      = new SerializationInfo(typeof(HttpWebResponse), new System.Runtime.Serialization.FormatterConverter());
            StreamingContext    sc      = new StreamingContext();
            WebHeaderCollection headers = new WebHeaderCollection();

            si.AddValue("m_HttpResponseHeaders", headers);
            si.AddValue("m_Uri", new Uri("http://localhost"));
            si.AddValue("m_Certificate", null);
            si.AddValue("m_Version", HttpVersion.Version11);
            si.AddValue("m_StatusCode", HttpStatusCode.OK);
            si.AddValue("m_ContentLength", 0);
            si.AddValue("m_Verb", "GET");
            si.AddValue("m_StatusDescription", "Local Response");
            si.AddValue("m_MediaType", null);

            WebResponseLocal response = new WebResponseLocal(si, sc);

            response.ResponseString = ResponseString;
            return(response);
        }
예제 #2
0
        public override WebResponse GetResponse()
        {
            SerializationInfo si = new SerializationInfo(typeof(HttpWebResponse), new System.Runtime.Serialization.FormatterConverter());
            StreamingContext sc = new StreamingContext();
            WebHeaderCollection headers = new WebHeaderCollection();
            si.AddValue("m_HttpResponseHeaders", headers);
            si.AddValue("m_Uri", new Uri("http://localhost"));
            si.AddValue("m_Certificate", null);
            si.AddValue("m_Version", HttpVersion.Version11);
            si.AddValue("m_StatusCode", HttpStatusCode.OK);
            si.AddValue("m_ContentLength", 0);
            si.AddValue("m_Verb", "GET");
            si.AddValue("m_StatusDescription", "Local Response");
            si.AddValue("m_MediaType", null);

            WebResponseLocal response = new WebResponseLocal(si, sc);
            response.ResponseString = ResponseString;
            return response;
        }