Gijsen Member Licensed User Longtime User Jun 29, 2016 #1 How can I post an Array to an url with OkHttputils ?
Gijsen Member Licensed User Longtime User Jun 29, 2016 #2 This seems to work, although it looks ugly... Code: httpJob.PostString("http://url?codes=" & listCodes, "") Upvote 0
This seems to work, although it looks ugly... Code: httpJob.PostString("http://url?codes=" & listCodes, "")
Erel B4X founder Staff member Licensed User Longtime User Jun 30, 2016 #3 There is no such thing as posting an array. It is up to you to convert the array to a string (or raw bytes). For example: Code: Dim sb As StringBuilder sb.Initialize If listCodes.Length > 0 Then For Each code As String In listCodes sb.Append(code).Append(",") Next sb.Remove(sb.Length - 1, sb.Length) End If httpJob.PostString("http://url, "listCodes=" & sb.ToString) Upvote 0
There is no such thing as posting an array. It is up to you to convert the array to a string (or raw bytes). For example: Code: Dim sb As StringBuilder sb.Initialize If listCodes.Length > 0 Then For Each code As String In listCodes sb.Append(code).Append(",") Next sb.Remove(sb.Length - 1, sb.Length) End If httpJob.PostString("http://url, "listCodes=" & sb.ToString)