Android Question Httpjob poststring or postbyte ?

tufanv

Expert
Licensed User
Longtime User
Hello,

What is the difference with poststring and postbyte while sennding a post request ? For example my payload includes non utf8 chars like turkish charachters so should i post bytes instead of string or does it have nothing to do with that ? I would be happy if someone can clearify this for me?
 

tufanv

Expert
Licensed User
Longtime User
I am trying to implement a payment system into the app. The company send me a php file which uses curl to post to their https. The php works without problem but when i send with httpjob pos i always get a "hash mismatch" error . Hash is calculated as the byte length of the values of the payload&the value.

I have to send the cc and other info directly to their remote url not to the php file so i cant use the php.

I cross check with the php , send exactly the same variables , the found hash is same with the php file, curl operation results with success but httpjob always returns hash mismatch. I tought maybe i am sending wrong but according to your answer it is not wrong.

It is really interesting tha curl succeeds but httpjob not. I can't find where the problem is.

PostString code:
B4X:
Public Sub PostString(Link As String, Text As String)
   PostBytes(Link, Text.GetBytes("UTF8"))
End Sub

If you need to send text with a different encoding then use PostBytes with the correct encoding.
 
Upvote 0
Top