If I use a header map with Content-Type and other 'normal' headers it works a it should.
But this:
Code: Select all
InitNetwork()
NewMap Header$()
Header$("Content-Type") = "application/json"
Header$("x-auth-token") = "123"
HTTPRequest(#PB_HTTP_Post, "http://www.purebasic.fr", "Test", 0, Header$())
Independent of the string it puts $e2808b $e2808b in front of the string.x-auth-token: \342\200\213\342\200\213123\r\n
Content-Type: application/json\r\n
0090 41 63 63 65 70 74 3a 20 2a 2f 2a 0d 0a 78 2d 61 Accept: */*..x-a
00a0 75 74 68 2d 74 6f 6b 65 6e 3a 20 e2 80 8b e2 80 uth-token: â..â.
00b0 8b 31 32 33 0d 0a 43 6f 6e 74 65 6e 74 2d 54 79 .123..Content-Ty
00c0 70 65 3a 20 61 70 70 6c 69 63 61 74 69 6f 6e 2f pe: application/
00d0 6a 73 6f 6e 0d 0a 43 6f 6e 74 65 6e 74 2d 4c 65 json..Content-Le
Very strange, since other custom headers works as expected.
Bernd