Android Question [SOLVED] HttpUtils2 with okHttp3 Disable redirect

mc73

Well-Known Member
Licensed User
Longtime User
The old disable (okHttp2) doesn't seem to work anymore.
Found this:
B4X:
OkHttpClient.Builder builder = new OkHttpClient.Builder();
builder.followRedirects(false);
OkHttpClient httpClient = builder.build();
How should I set it in my code using javaObject?
 

DonManfred

Expert
Licensed User
Longtime User
have you tried to set this in the service module?

B4X:
 hc.Initialize("hc")
        hc.SetHttpParameter("http.protocol.handle-redirects", False)
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
have you tried to set this in the service module?

B4X:
 hc.Initialize("hc")
        hc.SetHttpParameter("http.protocol.handle-redirects", False)
Sure, and it doesn't work any more:
B4X:
Error description: Unknown member: sethttpparameter
Error occurred on line: 29
hc.SetHttpParameter("http.protocol.handle-redirects", False)
 
Upvote 0
Top