konradwalsh Active Member Licensed User Longtime User Apr 14, 2016 #1 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?
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 Apr 14, 2016 #2 konradwalsh said: Ideas? Click to expand... 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: Apr 14, 2016 Upvote 0
konradwalsh said: Ideas? Click to expand... 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....
DonManfred Expert Licensed User Longtime User Apr 14, 2016 #3 konradwalsh said: GetSessionTokens.Download(ServerInfo & "?MMSAuth=" & AuthToken & "?MMSAuthSig=" & AuthSigToken) Click to expand... 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 said: GetSessionTokens.Download(ServerInfo & "?MMSAuth=" & AuthToken & "?MMSAuthSig=" & AuthSigToken) Click to expand... btw: you are not setting any headers here: You are generating an INVALID get-request. Only ONE questionmark is allowed in the get parameters.
konradwalsh Active Member Licensed User Longtime User Apr 14, 2016 #4 DonManfred said: 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.... Click to expand... Thanks.. As I said read loads of posts but Keep failing.. I'll keep trying Upvote 0
DonManfred said: 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.... Click to expand... Thanks.. As I said read loads of posts but Keep failing.. I'll keep trying
DonManfred Expert Licensed User Longtime User Apr 14, 2016 #5 you did not show any trying which set´s a header. Working or not. No header https://www.b4x.com/android/forum/pages/results/?query=http+header&page=1&prefix=4 Did not find any useful thread? Upvote 0
you did not show any trying which set´s a header. Working or not. No header https://www.b4x.com/android/forum/pages/results/?query=http+header&page=1&prefix=4 Did not find any useful thread?
konradwalsh Active Member Licensed User Longtime User Apr 14, 2016 #6 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
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
DonManfred Expert Licensed User Longtime User Apr 14, 2016 #7 If you use okhttputils then you need to add okhttp too Upvote 0
konradwalsh Active Member Licensed User Longtime User Apr 14, 2016 #8 Let me try that again... Thanks Upvote 0
konradwalsh Active Member Licensed User Longtime User Apr 15, 2016 #9 DonManfred said: If you use okhttputils then you need to add okhttp too Click to expand... This was exactly the problem... thanks for your patience Upvote 0
DonManfred said: If you use okhttputils then you need to add okhttp too Click to expand... This was exactly the problem... thanks for your patience