Exemple #1
0
        public void WhenISendTheDetailsToTheMetaWeblogEndpoint()
        {
            var xmlRpc = ScenarioContext.Current.Get <RequestTop>(Keys.XmlRpcRequest);

            var request = HttpRequestMethods.CreateRequest("http://endjin.com/metaweblog", "text/xml", HttpMethod.Post, xmlRpc, new XmlMediaTypeFormatter());

            Print.HttpRequestMessage(request);

            var client = ScenarioContext.Current.Get <HttpClient>(Keys.HttpClient);

            HttpResponseMessage response = client.SendAsync(request, new CancellationTokenSource().Token).Result;

            Print.HttpResponseMessage(response);

            ScenarioContext.Current.Set(response, Keys.HttpResponseMessage);
        }