Beispiel #1
0
            public static HttpContent GetPositionAjaxContent(string encodedKeyword, string pageNum, string sid = null)
            {
                var pairs = new List <KeyValuePair <string, string> >(4)
                {
                    new KeyValuePair <string, string>("first", "false"),
                    new KeyValuePair <string, string>("pn", pageNum),
                    new KeyValuePair <string, string>("kd", encodedKeyword)
                };

                if (sid != null)
                {
                    pairs.Add(new KeyValuePair <string, string>("sid", sid));
                }
                var content = new FormUrlEncodedContent(pairs);

                content.Headers.ContentType = HttpConsole.GetOrAddContentType("application/x-www-form-urlencoded;UTF-8");
                return(content);
            }