Android Question Problem With okhttp and okhttputils2

victormedranop

Well-Known Member
Licensed User
Longtime User
Hi recently I was working with a web service consult.
all work great. using okhttp and utils2.
but now I got an error

java.io.FileNotFoundException: /: open failed: EISDIR (Is a directory)

using this code

B4X:
Dim j As HttpJob
 j.Initialize("", Me)
 j.PostString("http://248.10.10.127:81/",consultar)
 j.GetRequest.SetHeader("Login",Xlogin)
 j.GetRequest.SetHeader("PassWord",Xpassword)
 j.GetRequest.SetContentType("application/json")
 j.GetRequest.SetContentEncoding("UTF-8")
 Log(j.GetString)

I really don't now what to do with this error

so I try with module okhttp an services

I found my error in this function

B4X:
Public Sub GetString2(Encoding As String) As String
#if B4i
 Return res.GetString2(Encoding)
#else
 Dim tr As TextReader
 tr.Initialize2(File.OpenInput(HttpUtils2Service.TempFolder, taskId), Encoding)
 Dim res As String = tr.ReadAll
 tr.Close
 Return res
#End If
End Sub


I don't understand why try to read something I still don know if some one can give me light.

thanks,

Victor
 
Top