I am having a little difficulty with the post strings using iHtppUtils going to my jRDC server. If I leave the iOS post string unencoded the app throws out the error ResponseError: unsupported URL, however if I encode it using stringutils, the app sends the post but the jRDC server handler cannot read the method statement. This works perfectly fine in the B4A app using the same httputils2 library. I have read that the library already encodes the string, but for iOS this doesn't seem to like it, so I have to encode it with stringutils and then it goes.
My apologies, I am doing the best I can to try to explain my problem. I am not a developer so my interpretations or explanations may not be as technical as you may need them.
I will try again. So I have a B4XPages program that sends a POST request to my server (which is running the jRDC server program), in the B4A code the request completes on the server without an issue and a response received, however in the B4i code the POST request does not complete on the server and the reason from what I can see is that the POST request is encoded with "%" where as the server received string from the B4A app does not.
My apologies, I am doing the best I can to try to explain my problem. I am not a developer so my interpretations or explanations may not be as technical as you may need them.
I will try again. So I have a B4XPages program that sends a POST request to my server (which is running the jRDC server program), in the B4A code the request completes on the server without an issue and a response received, however in the B4i code the POST request does not complete on the server and the reason from what I can see is that the POST request is encoded with "%" where as the server received string from the B4A app does not.
Try in the B4J back end or any back end you use, to change %20 with the plus symbol ('+')... Also make it clear to the backend that the request is from B4i by adding an other querystring variable (f.e. &src=b4i) in order to make this replacement...
Try in the B4J back end or any back end you use, to change %20 with the plus symbol ('+')... Also make it clear to the backend that the request is from B4i by adding an other querystring variable (f.e. &src=b4i) in order to make this replacement...
This is the code in HttpJob that escapes the parameters (it is called from Job.Download2):
B4X:
Private Sub escapeLink(Link As String, Parameters() As String) As String
Dim sb As StringBuilder
sb.Initialize
sb.Append(Link)
If Parameters.Length > 0 Then sb.Append("?")
Dim su As StringUtils
For i = 0 To Parameters.Length - 1 Step 2
If i > 0 Then sb.Append("&")
sb.Append(su.EncodeUrl(Parameters(i), "UTF8")).Append("=")
sb.Append(su.EncodeUrl(Parameters(i + 1), "UTF8"))
Next
Return sb.ToString
End Sub
It only escapes the keys and values. Not the equal sign.
This is the code in HttpJob that escapes the parameters (it is called from Job.Download2):
B4X:
Private Sub escapeLink(Link As String, Parameters() As String) As String
Dim sb As StringBuilder
sb.Initialize
sb.Append(Link)
If Parameters.Length > 0 Then sb.Append("?")
Dim su As StringUtils
For i = 0 To Parameters.Length - 1 Step 2
If i > 0 Then sb.Append("&")
sb.Append(su.EncodeUrl(Parameters(i), "UTF8")).Append("=")
sb.Append(su.EncodeUrl(Parameters(i + 1), "UTF8"))
Next
Return sb.ToString
End Sub
It only escapes the keys and values. Not the equal sign.