private static PostData GetPostData(Session oS)
        {
            var postData = new PostData();
            string contentType = oS.oRequest["Content-Type"];

            postData.mimeType = Utilities.TrimAfter(contentType, ';');

            if (contentType.StartsWith("application/x-www-form-urlencoded", StringComparison.OrdinalIgnoreCase))
            {
                postData.@params = GetQueryString("http://fake/path?" + oS.GetRequestBodyAsString());
                return postData;
            }
            postData.text = oS.GetRequestBodyAsString();

            return postData;
        }
Exemple #2
0
        private static void AddPostData(Table subtable, PostData postData)
        {
            if (postData == null)
            {
                return;
            }
            Table tbl = CreateSubtable("postData", subtable);
            AddTextRow("mimeType", postData.mimeType, tbl);

            AddTextRow("text", postData.text, tbl);
            AddNameValueTable(tbl, postData.@params, "params");
            //AddTextRow("comment", postData.comment, tbl);
        }