POST /ajaxpro/Display,App_Code.ashx HTTP/1.1
Accept: */*
Accept-Language: zh-cn
x-ajaxpro-method: dsp1
Referer: http://www.xxxxx.com//html/Display.aspxContent-Type: text/plain; charset=utf-8
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)
Host: www.xxxxx.com
Content-Length: 102
Connection: Keep-Alive
Cache-Control: no-cache
postdata是
{"id":"10","br":"000","lid":"ch","dt":"1","mod":11,"str":"1999","ods":32,"lvstat":0,"currPage":2}
Accept: */*
Accept-Language: zh-cn
x-ajaxpro-method: dsp1
Referer: http://www.xxxxx.com//html/Display.aspxContent-Type: text/plain; charset=utf-8
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)
Host: www.xxxxx.com
Content-Length: 102
Connection: Keep-Alive
Cache-Control: no-cache
postdata是
{"id":"10","br":"000","lid":"ch","dt":"1","mod":11,"str":"1999","ods":32,"lvstat":0,"currPage":2}
http://www.cnblogs.com/deerchao/archive/2007/08/09/849361.html
Console.WriteLine ("\nPlease enter the data to be posted to the (http://www.contoso.com/codesnippets/next.asp) Uri :");// Create a new string object to POST data to the Url.
string inputData = Console.ReadLine ();
string postData = "firstone=" + inputData;
ASCIIEncoding encoding = new ASCIIEncoding ();
byte[] byte1 = encoding.GetBytes (postData);// Set the content type of the data being posted.
myHttpWebRequest.ContentType = "application/x-www-form-urlencoded";// Set the content length of the string being posted.
myHttpWebRequest.ContentLength = byte1.Length;Stream newStream = myHttpWebRequest.GetRequestStream ();newStream.Write (byte1, 0, byte1.Length);
Console.WriteLine ("The value of 'ContentLength' property after sending the data is {0}", myHttpWebRequest.ContentLength);// Close the Stream object.
newStream.Close ();--其实是从msdn抄的。为什么不查msdn呢--郁闷
一般情况是
postdata:"id=123&dt=345"
Content-Type: application/x-www-form-urlencoded
现在的情况是
postdata:{"id":"10","br":"000","lid":"ch","dt":"1","mod":11,"str":"1999","ods":32,"lvstat":0,"currPage":2}
Content-Type: text/plain; charset=utf-8