Android Question PostString with HttpUtils2, every Ascii -value?

Cadenzo

Active Member
Licensed User
Longtime User
I am posting a request as a string to my server:

Sub CallSyncServ(request As String)
Dim jobSync As HttpJob
jobSync.Initialize("JobSyncServ", Me)
Dim sServer As String = "http://myserver/mypage.aspx"
jobSync.PostString(sServer, request)
End Sub

In my Tests some chars in the request-string are changed on the server. So the '=' (Ascii 61) becomes a Ascii 17 or 18
Can I use every Byte in the string for transfer? Do I have to escape some Bytes? What can I do, that the '=' stays a '=' on the server?
 

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hello,
Could it help to urlEncode the string ?
 
Upvote 0

Cadenzo

Active Member
Licensed User
Longtime User
Thanks for your answer.
I hope this is not necessary, because the string is transfered via POST and is not an URL.
I have to use my own data-format, with delimeters Ascii 17 and 18 between the data-sets and I was so glad, that in my tests every byte seems to be allowed with the transfer.
So URL-Encoding is not the right choice. If it is only the '=' I could escape that, but I first want to find out here what is the best way.
 
Upvote 0

Cadenzo

Active Member
Licensed User
Longtime User
So I read the request on the asp.net-Server:

Dim sData As String = Request.Form(0) 'complete Request-String
'...
Dim sDS() As String = Split(sData, Sep2) 'Array of all Rows

Every byte is recieved ok, even the ascii 17 and 18, which is usesd as seperator-Byte. For now only the '=' makes problemes. In Details: The string is splittet in to an array with the seperator-Byte. But '=' also will split the string. This is the problem.
 
Upvote 0

Cadenzo

Active Member
Licensed User
Longtime User
Yes, this seems to work:
jobSync.PostString(sServer, request)
jobSync.GetRequest.SetContentType("text/plain")
But on server-side (in VB.NET or C#) instead of Request.Form(0) you should use Request.InputStream to copy the complete request to a string.

For me it is not clear, how it is possible to define the header as text/plain after sending the body, but it works :)
Thanks.
 
Upvote 0
Top