示例#1
0
        public void TestBuildRequestIq()
        {
            var put = new Put
            {
                Url = "https://upload.montague.tld/4a771ac1-f0b2-4a4a-9700-f2a26fa2bb67/tr%C3%A8s%20cool.jpg"
            };

            put.AddHeader(HeaderNames.Authorization, "Basic Base64String==");
            put.AddHeader(HeaderNames.Cookie, "foo=bar; user=romeo");

            var get = new Get
            {
                Url = "https://download.montague.tld/4a771ac1-f0b2-4a4a-9700-f2a26fa2bb67/tr%C3%A8s%20cool.jpg"
            };

            var slot = new Slot
            {
                Put = put,
                Get = get,
            };

            var iq = new Iq {
                Type = Matrix.Xmpp.IqType.Result, Id = "step_03", To = "[email protected]/garden", From = "upload.montague.tld"
            };

            iq.Add(slot);

            iq.ShouldBe(Resource.Get("Xmpp.HttpUpload.slot-request-iq.xml"));
        }