Android Question [SOLVED] Http Headers In Request -[ Use OKHTTP AND OKHTTPUTILS2]

konradwalsh

Active Member
Licensed User
Longtime User
Hi

I have read loads of posts on this but cant find what I am doing wrong..

I need to pass headers to a request
I am using OkHttpUtils2

B4X:
    Dim GetSessionTokens As HttpJob
                    GetSessionTokens.Initialize("GetSessionToken", Me)
                    GetSessionTokens.Download(ServerInfo & "?MMSAuth=" & AuthToken & "?MMSAuthSig=" & AuthSigToken)

I have also tried
B4X:
GetSessionTokens.Download2(ServerInfo, Array As String("MMSAuth",AuthToken,"MMSAuthSig",AuthSigToken))


Ideas?
 

DonManfred

Expert
Licensed User
Longtime User
Sure. Search the forum! There are a lot of examples. Also a lot of similar questions (including the solution)

PS: See my libraries overview in my signature; the is a link to my dropbox class. It is massively using headers, jsonposts with okhttp....
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
GetSessionTokens.Download(ServerInfo & "?MMSAuth=" & AuthToken & "?MMSAuthSig=" & AuthSigToken)
btw: you are not setting any headers here: You are generating an INVALID get-request. Only ONE questionmark is allowed in the get parameters.
 
Upvote 0

konradwalsh

Active Member
Licensed User
Longtime User
Sure. Search the forum! There are a lot of examples. Also a lot of similar questions (including the solution)

PS: See my libraries overview in my signature; the is a link to my dropbox class. It is massively using headers, jsonposts with okhttp....
Thanks.. As I said read loads of posts but Keep failing..
I'll keep trying
 
Upvote 0

konradwalsh

Active Member
Licensed User
Longtime User
I did read everything.. I repeatedly came across similar to this
B4X:
job1.GetRequest.SetHeader("Accept-Language","de-de,de;q=0.8,en-us;q=0.5,en;q=0.3")

But whenever I try to use setheader it complains I don't have the library installed

I have every library regarding http,okhttp2, okhttp.. Etc already installed

I have tried checking and unchecking each library to see which one it's dependant on
 
Upvote 0
Top