Need help with HTTP problems

Discussion in 'Questions (Windows Mobile)' started by Medics, Jun 5, 2009.

  1. Medics

    Medics New Member Licensed User

    Hi all!

    I am new with Basic4ppc and I need help using HTTP requests. :sign0104:

    I use a timer to transfer data periodically to a webserver.
    Code:
    Sub Timer1_Tick
       URL=
    "http://myserver.com/senddata.php&data=" & data
       WebResponse.New1
       WebRequest.New1(URL)
       WebResponse.Value = WebRequest.GetResponse
       WebResponse.Close
    End Sub
    The problem is when the phone looses connection I get an error message:
    I am searching for a solution to handle or ignore timeouts.
    My HTTP.DLL is version 1.5

    Someone can help me please?

    Christian
     
  2. Byak@

    Byak@ Active Member Licensed User

    you can do
    Sub Timer1_Tick
    errorlabel(resperr)
    URL="http://myserver.com/senddata.php&data=" & data
    WebResponse.New1
    WebRequest.New1(URL)
    WebRequest.timeout=60000
    WebResponse.Value = WebRequest.GetResponse
    resperr:
    WebResponse.Close
    End Sub
     
  3. Medics

    Medics New Member Licensed User

    Thank you Byak@

    That worked for me.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice