adding multiple headers in loadRequest?

109 views Asked by At

I want to add multiple headers in my controller.LoadRequest in flutter

_controller.loadRequest(
      Uri.dataFromString(fileHtmlContents,mimeType: 'text/html', encoding: Encoding.getByName('utf-8')),
      headers: {
        "name":"xxxx",
        "value":"xxxxx",
        "name":"yyyy",//I WANT TO ADD 2 HEADERS İN HERE 
        "value":"yyyy"//  
      }
    );

first header gets name and value and second header gets same but it didnt works

please help ı dont know what can ı do

1

There are 1 answers

0
tomerpacific On

Looking at the documentation for webview_flutter:

Currently, setting custom headers when making a post request with the WebViewController's loadRequest method is not supported on Android. If you require this functionality, a workaround is to make the request manually, and then load the response data using loadHtmlString instead.

I am assuming that this is your use case (you did not provide all of the details).