HTTP request does not work anymore

RobVanBrunschot

Member
Licensed User
Longtime User
Hello,

I am trying to download sunrise/set data from earthtools.org and has been succesfull but now it does not work anymore.

The steps done are;
1. get the location of a town from Google.com
2. get the timezone of the location from earthtools.org
3. get the sunrise/set times from earthtools.org
4. finally get the weather data from Google

All 4 parts use request and response objects but now the sunrise/set call does not return any data and goes to the errorlabel

Am I doing any thing faulty ?

My parameters are;
myLatitude = 52.0782886
myLongitude = 4.3136850
myTimeZone = 1
Also, when I do it manual, it works okee
(http://www.earthtools.org/sun/52.0782886/4.3136850/2/2/1/0)

Code;
Sub DownloadSunRiseSetData(myLatitude,myLongitude,myTimezone)
DOWNLOAD_DATA = ""
ErrorLabel(DownloadSunRiseSetDataError)
DoEvents
DateFormat("d/m")
Request.New1("http://www.earthtools.org/sun/" & myLatitude & "/" & myLongitude & "/" & Date(Now) & "/" & myTimezone & "/0")
Request.Method = "GET"
Request.TimeOut = 30000
Response.New1
Response.Value = Request.GetResponse
DOWNLOAD_DATA = Response.GetString
Response.Close
Return
DownloadSunRiseSetDataError:
Response.Close
DOWNLOAD_DATA = "Err"
Return
End Sub
 

RobVanBrunschot

Member
Licensed User
Longtime User
Zenerdiode,

Thank you for the response.

What I had was 4 different subroutines with the same structure for calling HTTP request. After I have changed the code so I now only have two routines left, the error has gone.

Could it be that to many subroutines with HTTP request causes errors?

Anyway, it is working now.

Greetings,
Rob
 

mjcoon

Well-Known Member
Licensed User
Could it be that to many subroutines with HTTP request causes errors?

So long as none of them were called from one of the others they should be independent and not interact within Basic4PPC. But of course they could be tripping up following HTTP interactions somehow. Difficult to know whithout the diagnostics.

Are you now doing the same steps successfully?

Mike.
 

RobVanBrunschot

Member
Licensed User
Longtime User
Yes, all the steps are now being done via a specific module so no interference.

It runs perfectly now.

Regards, Rob
 

Absit

New Member
HTTP TILT my iPAQ

HTTP dont work anymore. :BangHead:

DoEvents
Request.New1("http://twitter.com/statuses/public_timeline.xml")
Request.Method = "GET"
Request.TimeOut = 60000
Response.New1
Response.Value = Request.GetResponse
Textbox2.Text = Response.GetString
Response.Close
 
Top