mardi 28 février 2017

Xamarin Android: How do i open add header and send post request in webview

I have made a webviewclient to intercept the request and adding the header and call loadUrl but unsure it works yet.

public override bool ShouldOverrideUrlLoading(Android.Webkit.WebView view, IWebResourceRequest request)
        { 
            var headers = new System.Collections.Generic.Dictionary<string, string>();
            headers.Add("Authorization", "bearer " + "s2vIKZd_P91MaaxaZ_XyeUpph6wQNrQ81pcQdUXjFTB3r48RaU9");
            view.LoadUrl(request.Url.ToString(), headers );
            return true;
        }

I can load the page with DefaultHttpClient but it was deprecated.




Aucun commentaire:

Enregistrer un commentaire