Android Question [solved] Json file password

Almog

Active Member
Licensed User
Hello,

I tried to use OkHttpUtils2 with json,
the file adress have a key/password to get to the data.
I used j.password =
but The Log result is:
"ResponseError. Reason: Unauthorized, Response: {"message":"Need to provide a secret-key to READ private bins","success":false}"


B4X:
Sub Activity_Create(FirstTime As Boolean)

    Dim j As HttpJob
    j.Initialize("",Me)
    j.Password = "********************"
    j.Download("*********************")
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
        Log(j.GetString)
    End If
    j.Release

End Sub

Does anybody know how to solve that?

Thanks in advance.
 

Almog

Active Member
Licensed User
B4X:
j.Download2(SomeURL, Array As String("password", PASSWORD))

Thanks,

But still get the same result.. (
"ResponseError. Reason: Unauthorized, Response: {"message":"Need to provide a secret-key to READ private bins","success":false}" )


B4X:
Dim j As HttpJob
    j.Initialize("",Me)
    j.Password = "****************"
    
    j.Download2("****************",Array As String("password", j.Password))
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
        Log(j.GetString)
    End If
    j.Release

Thanks in advance.
 
Upvote 0

monic

Active Member
Licensed User
Longtime User
Different issue solved with:

B4X:
Dim j As HttpJob
    j.Initialize("",Me)
    j.Download("xx") '
    j.GetRequest.SetHeader("secret-key", "xx")
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
        Log(j.GetString)
    End If
    j.Release
 
Upvote 0

Almog

Active Member
Licensed User
Different issue solved with:

B4X:
Dim j As HttpJob
    j.Initialize("",Me)
    j.Download("xx") '
    j.GetRequest.SetHeader("secret-key", "xx")
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
        Log(j.GetString)
    End If
    j.Release

Thank you..
 
Upvote 0
Top