requesting ajax via HttpWebRequest

Posted by Sami Abdelgadir Mohammed on Stack Overflow See other posts from Stack Overflow or by Sami Abdelgadir Mohammed
Published on 2011-01-04T23:24:50Z Indexed on 2011/01/04 23:54 UTC
Read the original article Hit count: 310

Hi guys: I'm writing a simple application that will download some piece of data from a website then I can use it later for any purpose The following is the request and response copied from Firebug as the browser did that... when u type http://x5.travian.com.sa/ajax.php?f=k7&x=18&y=-186&xx=12&yy=-192 you will get a php file has some data.. But when I make a request with HttpWebRequest I get wrong data (some unknown letters) Can anyone help me in that.. and if I have to make some encodings or what?? I will be so appreciated..

Response

  1. Server nginx
  2. Date Tue, 04 Jan 2011 23:03:49 GMT
  3. Content-Type application/json; charset=UTF-8
  4. Transfer-Encoding chunked
  5. Connection keep-alive
  6. X-Powered-By PHP/5.2.8
  7. Expires Mon, 26 Jul 1997 05:00:00 GMT
  8. Last-Modified Tue, 04 Jan 2011 23:03:49 GMT
  9. Cache-Control no-store, no-cache, must-revalidate, post-check=0, pre-check=0
  10. Pragma no-cache
  11. Content-Encoding gzip
  12. Vary Accept-Encoding

Request

  1. Host x5.travian.com.sa
  2. User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13)
  3. Gecko/20101203 Firefox/3.6.13
  4. Accept text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
  5. Accept-Language en-us,en;q=0.5
  6. Accept-Encoding gzip,deflate
  7. Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
  8. Keep-Alive 115
  9. Connection keep-alive
  10. Cookie CAD=57878984%231292375897%230%230%23%230; T3E=%3DImYykTN2EzMmhjO5QTM2QDN2oDM1ITOyoDOxIjM4EDN5ITM6gjO4MDOxIWZyQWMipTZu9metl2ctl2c6MDNxADN6MDNxADNjMDNxADNjMDNxADN; orderby_b1=0; orderby_b=0; orderby2=0; orderby=0

© Stack Overflow or respective owner

Related posts about AJAX

Related posts about encoding