Android Question Error when SetHeaders HttpJob with Special Characters 'Ñ'

scsjc

Well-Known Member
Licensed User
Longtime User
I'm use a HttpJob to send a PostMultipart, with a GetRequest.SetHeader("user","baño") and get error:

B4X:
java.lang.IllegalArgumentException: Unexpected char 0xf1 at 4 in user value: baño

B4X:
Dim j As HttpJob
        j.Initialize("", Me)
        Dim fd As MultipartFileData
        fd.Initialize
        fd.KeyName = "file"
        fd.Dir = File.DirInternal
        fd.FileName = "file.jpg"
        fd.ContentType = "image/jpg"
        j.PostMultipart(posturl, null, Array(fd))
        j.GetRequest.SetHeader("user", "baño")
        Wait For (j) JobDone(j As HttpJob)
        If j.Success Then
            Log(j.GetString)
        End If
        j.Release
 

DonManfred

Expert
Licensed User
Longtime User
Headers usually do not have any chars different from 7Bit Charset.
For authentification the values in headers are usually encrypted/base64´ed
 
Last edited:
Upvote 0
Top