HTTP Library

Discussion in 'Questions (Windows Mobile)' started by bish0p, Sep 12, 2008.

  1. bish0p

    bish0p Member Licensed User

    I don't know if I am doing something wrong with the HTTP Library but this code


    Code:
    Sub Getfound()


       wwwreq2.New1(
    "http://www.geocaching.com/my/")
       wwwreq2.TimeOut=
    120000
       wwwreq2.AddHeader(
    "Cookie",GC_Session_ID&" "&GC_user_id)
       
    Msgbox(wwwreq2.Headers)
       wwwres2.Value = wwwreq2.GetResponse

       tmp=wwwres2.GetString
       Textbox1.Text=tmp
       
    regex.New1("Caches Found: [0-9]+")
       match.Value=
    regex.Match(tmp)
       
       
    Return SubString(match.String,13,StrLength(match.String))
    End Sub
    Works like a charm on the Desktop hangs on the "wwwres2.Value = wwwreq2.GetResponse" on my device

    After I have logged onto the site I ask it to fetch the number of caches I have found. This is done my calling Geocaching - Login with the ASP.NET_SessionID set to the correct Cookie,

    It seems that once I have connected to 2 URLS it the device hangs on the third call to GetResponse. Yes I have the current version of the HTTP Lib.

    Any Ideas.

    James
     
    Last edited: Sep 12, 2008
  2. Mr_Gee

    Mr_Gee Active Member Licensed User

    Maybe you need to close the webresponse before starting a new one?
    (just thinking out loud here)

    -=edit=-
    seems to a correct assumption, form the help file :
    -----
    Sub GetText (URL)
    Response.New1
    Request.New1(URL)
    Response.Value = Request.GetResponse 'This line calls the server and gets the response.
    string = Response.GetString 'Get the Response string.
    Response.Close
    return string
    End Sub
     
    Last edited: Sep 12, 2008
  3. agraham

    agraham Expert Licensed User

    Well spotted Mr_Gee :sign0188:. From the book "Network Programming for the .NET Framework".
    So even if not the root problem here definitely something that needs doing in any case.
     
  4. bish0p

    bish0p Member Licensed User

    Yup that did it, I don't know how I missed that ...

    Thanks
     
  5. Mr_Gee

    Mr_Gee Active Member Licensed User

    thanks for the compliment agraham ;)
     
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