I try to send a large JSON string in the parameters using Job.Download2 with HttpUtils2 as explained in
httputils2: Send a large array as a JSON string via Job.Download2 to a php script
JobDone returns an error "Request-URI Too Long"
I search from Internet and found that I need to modify the LimitRequestLine in Apache conf.
Here is my code
Please help.
httputils2: Send a large array as a JSON string via Job.Download2 to a php script
JobDone returns an error "Request-URI Too Long"
I search from Internet and found that I need to modify the LimitRequestLine in Apache conf.
Here is my code
B4X:
' Used to Add New / Update Existing Notes to Cloud
Sub UploadNotes
Dim cur As Cursor
Dim qry As String
Dim jsn As String
Dim gen As JSONGenerator
Dim L1 As List
Dim M1 As Map
L1.Initialize
Try
qry = "SELECT * FROM MyNotes ORDER BY id"
cur = DB.ExecQuery(qry)
For i = 0 To cur.RowCount - 1
cur.Position = i
M1.Initialize
M1.Put("id", cur.GetInt("id"))
M1.Put("aa", cur.GetString("aa"))
M1.Put("bb", cur.GetString("bb"))
M1.Put("cc", cur.GetString("dd"))
M1.Put("ee", cur.GetInt("ee"))
L1.Add(M1)
Next
gen.Initialize2(L1)
jsn = gen.ToString
Dim HJ As HttpJob
Dim strURL As String
HJ.Initialize("UploadNotes", Me)
strURL = ServerURL & "note-upload.php"
HJ.Download2(strURL, Array As String("ui", gUser, "pw", gPassword, "json", jsn))
Catch
Log("Error: " & LastException.Message)
ToastMessageShow("Error: UploadNotes", False)
End Try
End Sub
Please help.