S Smee Well-Known Member Licensed User Longtime User Jan 13, 2013 #1 I am trying to get job1.Download2 to work but i dont understand how it works This works ok Code: job1.Download("http://website.com/scores.php?secret=PW&id=showUser&deviceID="&deviceID&"&type=1") this obviously does not work Code: job1.Download2("http://website.com/scores.php?secret=Test&id=showUser&deviceID="&deviceID&"&type=1", _ Array As String("name", value, "score", value2)) With the first statement i get 2 fields returned ok but the second throws an error. What is the correct syntax for download2? and how could i parse the result for download? Thanks for any replies Last edited: Jan 13, 2013
I am trying to get job1.Download2 to work but i dont understand how it works This works ok Code: job1.Download("http://website.com/scores.php?secret=PW&id=showUser&deviceID="&deviceID&"&type=1") this obviously does not work Code: job1.Download2("http://website.com/scores.php?secret=Test&id=showUser&deviceID="&deviceID&"&type=1", _ Array As String("name", value, "score", value2)) With the first statement i get 2 fields returned ok but the second throws an error. What is the correct syntax for download2? and how could i parse the result for download? Thanks for any replies
Erel B4X founder Staff member Licensed User Longtime User Jan 13, 2013 #2 Code: job1.Download2("http://website.com/scores.php", _ Array As String("secret", "Test", "id", "showUser", "deviceID", deviceID, "type", "1", "name", value, "score", value2)) Upvote 0
Code: job1.Download2("http://website.com/scores.php", _ Array As String("secret", "Test", "id", "showUser", "deviceID", deviceID, "type", "1", "name", value, "score", value2))
S Smee Well-Known Member Licensed User Longtime User Jan 13, 2013 #3 Thanks Erel, I tried that but the fields value and value2 are empty I changed value to value1 I dimmed them in process globals Dim value1,value2 As String then Code: Sub JobDone (Job As HttpJob) Log("JobName = " & Job.JobName & ", Success = " & Job.Success) Dim st As String If Job.Success = True Then Select Job.JobName Case "Job1", "Job2" 'print the result to the logs Log(value1) Log(value2) st=Job.GetString Log(Job.GetString) Although i still get a result in st Upvote 0
Thanks Erel, I tried that but the fields value and value2 are empty I changed value to value1 I dimmed them in process globals Dim value1,value2 As String then Code: Sub JobDone (Job As HttpJob) Log("JobName = " & Job.JobName & ", Success = " & Job.Success) Dim st As String If Job.Success = True Then Select Job.JobName Case "Job1", "Job2" 'print the result to the logs Log(value1) Log(value2) st=Job.GetString Log(Job.GetString) Although i still get a result in st
Erel B4X founder Staff member Licensed User Longtime User Jan 13, 2013 #4 The fields will be set with the values stored in the relevant variables. If the variables are empty then the fields will be empty. About the download, what is printed from this line: Code: Log("JobName = " & Job.JobName & ", Success = " & Job.Success) Upvote 0
The fields will be set with the values stored in the relevant variables. If the variables are empty then the fields will be empty. About the download, what is printed from this line: Code: Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
S Smee Well-Known Member Licensed User Longtime User Jan 13, 2013 #5 This is an abbreviated log ** Service (httputils2service) Create ** ** Service (httputils2service) Start ** JobName = Job1, Success = true 1 Joe 123456 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 ** Activity (main) Pause, UserClosed = false ** ** Service (httputils2service) Destroy ** Upvote 0
This is an abbreviated log ** Service (httputils2service) Create ** ** Service (httputils2service) Start ** JobName = Job1, Success = true 1 Joe 123456 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 ** Activity (main) Pause, UserClosed = false ** ** Service (httputils2service) Destroy **
Erel B4X founder Staff member Licensed User Longtime User Jan 13, 2013 #6 This is the response from the server: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Click to expand... Upvote 0
This is the response from the server: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Click to expand...
S Smee Well-Known Member Licensed User Longtime User Jan 13, 2013 #7 yeah i dont get that with download. Although i do with another query later on. I will try to work that out later with download i get this Installing file. PackageAdded: package:scores.test ** Activity (main) Create, isFirst = true ** ** Activity (main) Resume ** ** Service (httputils2service) Create ** ** Service (httputils2service) Start ** JobName = Job1, Success = true Joe 123456 Last edited: Jan 13, 2013 Upvote 0
yeah i dont get that with download. Although i do with another query later on. I will try to work that out later with download i get this Installing file. PackageAdded: package:scores.test ** Activity (main) Create, isFirst = true ** ** Activity (main) Resume ** ** Service (httputils2service) Create ** ** Service (httputils2service) Start ** JobName = Job1, Success = true Joe 123456
S Smee Well-Known Member Licensed User Longtime User Jan 13, 2013 #8 Ok i was mixing two separate lines this works ok job1.Download("http://website.com/scores.php?secret=Test&id=view&start=0&end=100&type="&difficulty) This does not job1.Download2("http://website.com/scores.php", _ Array As String("secret", "Test", "id", "view", "start" ,0 ,"end", 100 , "type", 1, "name", value1, "score", value2)) the log is this from download2 Installing file. PackageAdded: package:scores.test ** Activity (main) Create, isFirst = true ** ** Activity (main) Resume ** ** Service (httputils2service) Create ** ** Service (httputils2service) Start ** JobName = Job1, Success = true Joe 123456 ** Service (httputils2service) Destroy ** But the fields value 1 and value2 are empty the log results are from Log(value1) Log(value2) st=Job.GetString Log(Job.GetString) hope this makes more sense :BangHead: Upvote 0
Ok i was mixing two separate lines this works ok job1.Download("http://website.com/scores.php?secret=Test&id=view&start=0&end=100&type="&difficulty) This does not job1.Download2("http://website.com/scores.php", _ Array As String("secret", "Test", "id", "view", "start" ,0 ,"end", 100 , "type", 1, "name", value1, "score", value2)) the log is this from download2 Installing file. PackageAdded: package:scores.test ** Activity (main) Create, isFirst = true ** ** Activity (main) Resume ** ** Service (httputils2service) Create ** ** Service (httputils2service) Start ** JobName = Job1, Success = true Joe 123456 ** Service (httputils2service) Destroy ** But the fields value 1 and value2 are empty the log results are from Log(value1) Log(value2) st=Job.GetString Log(Job.GetString) hope this makes more sense :BangHead:
Erel B4X founder Staff member Licensed User Longtime User Jan 13, 2013 #9 value1 and value2 variables should be set before you call job1.Download2(...). You can use the debugger to better understand how Download2 works. It is quite simple. Upvote 0
value1 and value2 variables should be set before you call job1.Download2(...). You can use the debugger to better understand how Download2 works. It is quite simple.
S Smee Well-Known Member Licensed User Longtime User Jan 13, 2013 #10 Erel said: value1 and value2 variables should be set before you call job1.Download2(...). Click to expand... Yes it does seem simple enough but i am not getting the expected results. When you say the Variables should be set before I call download 2 i assume that you mean dim? That is done in Code: Sub Process_Globals Dim job1, job2, job3 As HttpJob Dim value1,value2 As String End Sub They return empty but if i look at the variable st i can see the correct result Code: Sub JobDone (Job As HttpJob) Log("JobName = " & Job.JobName & ", Success = " & Job.Success) Dim st As String If Job.Success = True Then Select Job.JobName Case "Job1", "Job2" 'print the result to the logs Log(value1) Log(value2) st=Job.GetString Log(st) Log("") Upvote 0
Erel said: value1 and value2 variables should be set before you call job1.Download2(...). Click to expand... Yes it does seem simple enough but i am not getting the expected results. When you say the Variables should be set before I call download 2 i assume that you mean dim? That is done in Code: Sub Process_Globals Dim job1, job2, job3 As HttpJob Dim value1,value2 As String End Sub They return empty but if i look at the variable st i can see the correct result Code: Sub JobDone (Job As HttpJob) Log("JobName = " & Job.JobName & ", Success = " & Job.Success) Dim st As String If Job.Success = True Then Select Job.JobName Case "Job1", "Job2" 'print the result to the logs Log(value1) Log(value2) st=Job.GetString Log(st) Log("")
S Smee Well-Known Member Licensed User Longtime User Jan 14, 2013 #11 Erel, I have stepped through the debugger to no avail. I have read through 7 pages of a search result of download2 still no success. In the http module the example given the values are listed as strings, i dont understand how a result code be passed back to these strings but i tried it anyway, Didn't work Code: job.Download2("http://www.example.com", _ ' Array As String("key1", "value1", "key2", "value2")) As i said i have declared the two values to hold the return in globals but they are empty when the routines are finished. The variable st does hold the correct result when called st=Job.GetString But how do i parse that to variables? :BangHead::BangHead: Upvote 0
Erel, I have stepped through the debugger to no avail. I have read through 7 pages of a search result of download2 still no success. In the http module the example given the values are listed as strings, i dont understand how a result code be passed back to these strings but i tried it anyway, Didn't work Code: job.Download2("http://www.example.com", _ ' Array As String("key1", "value1", "key2", "value2")) As i said i have declared the two values to hold the return in globals but they are empty when the routines are finished. The variable st does hold the correct result when called st=Job.GetString But how do i parse that to variables? :BangHead::BangHead:
Erel B4X founder Staff member Licensed User Longtime User Jan 14, 2013 #12 I'm afraid that Download2 is simpler than you think. It is just a small utility that helps you correctly build the request query. It is not related to the response. Upvote 0
I'm afraid that Download2 is simpler than you think. It is just a small utility that helps you correctly build the request query. It is not related to the response.
S Smee Well-Known Member Licensed User Longtime User Jan 14, 2013 #13 ok i get that. I realise that so ignoring the fact that the 2 variables are returning empty, how do i parse this correctly Code: Log("JobName = " & Job.JobName & ", Success = " & Job.Success) st=Job.GetString Log(st) This gives this output JobName = Job1, Success = true Joe 123456 In between "Joe" & "12345" are characters probably Chr(10) and (13) how could i strip them from the variable that is returned? Upvote 0
ok i get that. I realise that so ignoring the fact that the 2 variables are returning empty, how do i parse this correctly Code: Log("JobName = " & Job.JobName & ", Success = " & Job.Success) st=Job.GetString Log(st) This gives this output JobName = Job1, Success = true Joe 123456 In between "Joe" & "12345" are characters probably Chr(10) and (13) how could i strip them from the variable that is returned?
S Smee Well-Known Member Licensed User Longtime User Jan 14, 2013 #14 Erel, I'm afraid that Download2 is simpler than you think. It is just a small utility that helps you correctly build the request query. It is not related to the response. Click to expand... It took a while but the penny has finally dropped. Sometimes one cannot see the forest for the trees :signOops: I will open a new thread for my other question Thanks for the patience Upvote 0
Erel, I'm afraid that Download2 is simpler than you think. It is just a small utility that helps you correctly build the request query. It is not related to the response. Click to expand... It took a while but the penny has finally dropped. Sometimes one cannot see the forest for the trees :signOops: I will open a new thread for my other question Thanks for the patience
ciprian Active Member Licensed User Longtime User Aug 16, 2013 #15 Hi there. I have some problems with job.download. What is the corect syntax for: job.download("http://user:[email protected]:8010/index.xml") If i disable the user and password...job.download("http://192.168.0.51:8010/index.xml") all fine. But with the user and password not. I think i shall use job.download2 instead, but i don't know the corect syntax. Upvote 0
Hi there. I have some problems with job.download. What is the corect syntax for: job.download("http://user:[email protected]:8010/index.xml") If i disable the user and password...job.download("http://192.168.0.51:8010/index.xml") all fine. But with the user and password not. I think i shall use job.download2 instead, but i don't know the corect syntax.
ciprian Active Member Licensed User Longtime User Aug 16, 2013 #16 I found it by myself..job.username and job.password. Thank you. Upvote 0