Results 1 to 7 of 7

Thread: HTTPrequest problem

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2009
    Posts
    112

    Question HTTPrequest problem

    This is a raw data of a website ( Got it using fiddler )

    Code:
    HTTP/1.1 200 OK
    Date: Thu, 26 Aug 2010 00:30:34 GMT
    Server: Apache
    X-Powered-By: PHP/5.2.9
    Vary: Accept-Encoding
    Content-Length: 376
    Keep-Alive: timeout=2, max=50
    Connection: Keep-Alive
    Content-Type: text/html; charset=UTF-8
    I posted some data using http request on it and got this in return

    Code:
    HTTP/1.1 200 OK
    Date: Thu, 26 Aug 2010 01:30:00 GMT
    Server: Apache
    X-Powered-By: PHP/5.2.9
    Vary: Accept-Encoding
    Content-Length: 543
    Content-Type: text/html; charset=UTF-8
    I can't get to post the data with the code below

    VB Code:
    1. Dim webRequest As HttpWebRequest
    2.         Dim responseReader As StreamReader
    3.         Dim responseData As String
    4.         Dim postData As String
    5.         Dim part As String() = Label6.Text.ToString.Split(" ")
    6.         postData = "uri=http%3A%2F%2Fxxx.com%2Fxxx%2xxx.php&sender=" & Sms_From.Text & "&sms_to=" & Sms_To.Text & "&sms_text=" & RichTextBox1.Text & "&limit=" & part(2)
    7.         webRequest = TryCast(Net.WebRequest.Create("http://xxxxxxxx/xxx.php"), HttpWebRequest)
    8.         webRequest.Method = "POST"
    9.         webRequest.ContentType = "application/x-www-form-urlencoded"
    10.         webRequest.CookieContainer = cookies
    11.         Dim requestWriter As New StreamWriter(webRequest.GetRequestStream())
    12.         requestWriter.Write(postData)
    13.         requestWriter.Close()
    14.         responseReader = New StreamReader(webRequest.GetResponse().GetResponseStream())
    15.         responseData = responseReader.ReadToEnd()
    16.         responseReader.Close()

    So these things are missing in my sent data

    Code:
    Keep-Alive: timeout=2, max=50
    Connection: Keep-Alive
    I'm not sure what i am doing wrong here , Anyone can help me out ?

  2. #2

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2009
    Posts
    112

    Re: HTTPrequest problem

    Image #1


    Image #2


    The Image #1 is showing the captured data from the website and the Image #2 is showing the captured data from the application.

    I tried your way of adding the time-out and keep-alive which i actually did before but it ain't work , I need the same reply as in Image #1 from my application.

    Hope i cleared everything.

  4. #4
    PowerPoster cicatrix's Avatar
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,654

    Re: HTTPrequest problem

    It has nothing to do with keep-alive and timeout properties. Something is missing or wrong in your POST data. The same Fiddler can intercept your own requests made by a browser or your application.
    You will need to compare the two and see if there are any differences.

  5. #5
    Junior Member
    Join Date
    Sep 2010
    Posts
    17

    Re: HTTPrequest problem

    Hi Trav,

    Did you manage to suss this?

    have the same issue.

    thanks

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Sep 2009
    Posts
    112

    Re: HTTPrequest problem

    Yes , After playing a couple times with the coding i managed to get it working.

  7. #7
    Junior Member
    Join Date
    Sep 2010
    Posts
    17

    Re: HTTPrequest problem

    Fixed mine too, was not specifying the referal site, once i added that worked a treat

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width