iOS Question HttpJob - Error decoding data

Blueforcer

Well-Known Member
Licensed User
Longtime User
I want to clone my B4A app to iOS.

I download a json string from my server wich works fine in B4A:

B4X:
Dim j As HttpJob
    j.Initialize("bmplist", Me)
    j.PostString(link,$"{"reqType":"bmplist","filter":""}"$)
    j.GetRequest.SetContentType("application/json")
    Wait For JobDone (j As HttpJob)
    Log(j.GetString)

but i get an error in B4i:

B4X:
Class (b4i_httpjob) instance released.
Error occurred on line: 223 (HttpJob)
Error decoding data as string.
Stack Trace: (
  CoreFoundation       <redacted> + 252
  libobjc.A.dylib      objc_exception_throw + 56
  CoreFoundation       <redacted> + 0
  AWTRIXER             -[B4ICommon BytesToString::::] + 344
  AWTRIXER             -[B4IHttpResponse GetString2:] + 260
  AWTRIXER             -[b4i_httpjob _getstring2::] + 600
  AWTRIXER             -[b4i_httpjob _getstring:] + 408
  AWTRIXER             -[ResumableSub_iconlist_fill resume::] + 1696
  CoreFoundation       <redacted> + 144
  CoreFoundation       <redacted> + 292
 AWTRIXER             +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1624
 AWTRIXER             -[B4IShell runMethod:] + 448
 AWTRIXER             -[B4IShell raiseEventImpl:method:args::] + 2172
 AWTRIXER             -[B4IShellBI raiseEvent:event:params:] + 1580
 AWTRIXER             -[B4IDelegatableResumableSub resume::] + 380
 AWTRIXER             -[B4I checkAndRunWaitForEvent:event:params:] + 552
 AWTRIXER             -[B4ICommon CallSubDebug4::::] + 488
 AWTRIXER             -[B4ICommon CallSubDebug2::::] + 360
 AWTRIXER             -[b4i_httpjob _complete::] + 768
 AWTRIXER             -[b4i_httputils2service _completejob::::] + 1288
 AWTRIXER             -[b4i_httputils2service _hc_responsesuccess::] + 636
 CoreFoundation       <redacted> + 144
 CoreFoundation       <redacted> + 292
 AWTRIXER             +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1624
 AWTRIXER             -[B4IShell runMethod:] + 448
 AWTRIXER             -[B4IShell raiseEventImpl:method:args::] + 2172
 AWTRIXER             -[B4IShellBI raiseEvent:event:params:] + 1580
 AWTRIXER             __61-[B4IHttp URLSession:downloadTask:didFinishDownloadingToURL:]_block_invoke + 268
 libdispatch.dylib    <redacted> + 16
 libdispatch.dylib    <redacted> + 92
 libdispatch.dylib    <redacted> + 16
 libdispatch.dylib    <redacted> + 1068
 CoreFoundation       <redacted> + 12
 CoreFoundation       <redacted> + 1964
 CoreFoundation       CFRunLoopRunSpecific + 436
 GraphicsServices     GSEventRunModal + 100
 UIKitCore            UIApplicationMain + 212
 AWTRIXER             main + 124
 libdyld.dylib        <redacted> + 4
)


Whats the problem?
 

Blueforcer

Well-Known Member
Licensed User
Longtime User
With iso-8859-1 it works, but it is UTF8 and also works with UTF8 in B4A.
Whats the difference between encoding in B4A and B4i?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…