コード例 #1
0
        public static RestRequest BuildContactRequest(this PostalAddress postalAddress, string href)
        {
            var contactRequest = new RestRequest(href, Method.POST);

            contactRequest.AddHeader("Content-Type", "application/x-www-form-urlencoded");

            var queryParameters = HttpUtility.ParseQueryString(HttpUtility.UrlDecode(href));
            var mobjnr          = queryParameters["tx_sozaltbau_pi1[mobjnr]"];
            var mlfd            = queryParameters["tx_sozaltbau_pi1[mlfd]"];

            contactRequest.AddQueryParameter("xajax", "processMailForm");
            contactRequest.AddQueryParameter("xajaxargs[]", postalAddress.BuildAjaxQuery());
            contactRequest.AddQueryParameter("xajaxargs[]", mobjnr);
            contactRequest.AddQueryParameter("xajaxargs[]", mlfd);

            return(contactRequest);
        }