Hello
Sorry for my english
I try to access some data with B4A and/or B4X program on a web site (
www.waze.com)
The request which is OK via a brower htttp is :
https://www.waze.com/row-RoutingMan...4&to=x:5.074009895324707+y:47.323297853574104
I use the example program httpUtils2 whith a small modification :
Region Project Attributes
#MainFormWidth: 500
#MainFormHeight: 500
#LibraryName: jHttpUtils2
#LibraryVersion: 1.02
#MergeLibraries: false
#End Region
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private ImageView1 As ImageView
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
MainForm.Show
ImageView1.Initialize("")
MainForm.RootPane.AddNode(ImageView1, 0, 0, MainForm.Width, MainForm.Height)
Dim job1, job2, job3 As HttpJob
'Send a POST request
job1.Initialize("Job1", Me)
job2.Initialize("Job2", Me)
job1.PostString("
https://www.waze.com/row-rtserver/web/TGeoRSS?","ma=600&mj=100&mu=100&left=4.866085&right=4.892349&bottom=45.901924&top=45.955057")
job2.PostString("
https://www.waze.com/row-RoutingManager/routingRequest?","from=x%3A4.988061299999999+y%3A45.8205974&to=x%3A5.074009895324707+y%3A47.323297853574104")
' job2.Download("
https://www.waze.com/row-RoutingMan...4&to=x:5.074009895324707+y:47.323297853574104")
End Sub
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Select Job.JobName
Case "Job1", "Job2"
'print the result to the logs
Log(Job.GetString)
Case "Job3"
'show the downloaded image
ImageView1.SetImage(Job.GetBitmap)
End Select
Else
Log("Error: " & Job.ErrorMessage)
End If
Job.Release
End Sub
And I have the error "Forbidden" for the job2 but the job1 request is OK
If you ave a solution ?
Thank you very much