Am doing an Api call in flutter.
But the response is coming in <!DOCTYPE html> format.
Is it possible to handle this type of response?
Or is it possible to convert that response in json format?
If yes? Please share your answer. Thanks in Advance.
The following is the response:
<div class="otherhead">
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<!--[if IE 8 ]><html dir="ltr" lang="en" class="ie8"><![endif]-->
<!--[if IE 9 ]><html dir="ltr" lang="en" class="ie9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html dir="ltr" lang="en">
<!--<![endif]-->
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Account Login</title>
<base href="https://getbest.co.in/" />
<script src="catalog/view/javascript/jquery/jquery-2.1.1.min.js" type="text/javascript"></script>
<link href="catalog/view/javascript/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen" />
<script src="catalog/view/javascript/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="catalog/view/javascript/webiarch/product-slider-zoom/jquery.elevatezoom.js" type="text/javascript">
</script>
<link href="catalog/view/javascript/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,500,600,700" rel="stylesheet">
<link href="catalog/view/theme/default/stylesheet/stylesheet.css" rel="stylesheet">
<!-- blog image zoom -->
<script src="catalog/view/javascript/webiarch/blog/lightbox-2.6.min.js" type="text/javascript"></script>
<link href="catalog/view/javascript/webiarch/blog/lightbox.css" rel="stylesheet" type="text/css" />
<!-- blog image zoom -->
<!--right to left (RTL)-->
<!--over RTL-->
<script src="catalog/view/javascript/webiarch/custom.js" type="text/javascript"></script>
<link href="catalog/view/javascript/jquery/magnific/magnific-popup.css" type="text/css" rel="stylesheet"
media="screen" />
<link href="catalog/view/theme/default/stylesheet/webinewsletter.css" type="text/css" rel="stylesheet"
media="screen" />
<link href="catalog/view/javascript/jquery/webiquickview.css" type="text/css" rel="stylesheet" media="screen" />
<script src="catalog/view/javascript/jquery/magnific/jquery.magnific-popup.min.js" type="text/javascript">
</script>
<script src="catalog/view/javascript/jquery/webiquickview.js" type="text/javascript"></script>
<script src="catalog/view/javascript/jquery/webinewsletter.js" type="text/javascript"></script>
<script src="catalog/view/javascript/common.js" type="text/javascript"></script>
<link href="https://getbest.co.in/image/catalog/cart.png" rel="icon" />
<link href="https://getbest.co.in/index.php?route=extension/analytics/progressive_web_application/manifest"
rel="manifest" />
<script type="text/javascript">
function isFacebookApp() {var ua = navigator.userAgent || navigator.vendor || window.opera; return (ua.indexOf("FBAN") > -1) || (ua.indexOf("FBAV") > -1);}if (window.location.protocol == "https:" && window.isSecureContext) {if(!isFacebookApp()){if ("serviceWorker" in navigator) {if (navigator.serviceWorker.controller) {console.log("[PWA Builder] active service worker found, no need to register");} else {navigator.serviceWorker.register("https://getbest.co.in/index.php?route=extension/analytics/progressive_web_application/service_worker").then(function (reg) {console.log("[PWA Builder] Service worker has been registered for scope: " + reg.scope);});}}} else {console.log("[PWA Builder] The current browser doesn't support service workers.");}} else {console.log("[PWA Builder] The web site is not served from a secure (HTTPS) domain.");}
</script>
<meta name="theme-color" content="#000000" />
<meta name="msapplication-TileColor" content="#000000" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="#000000" />
<meta name="apple-mobile-web-app-title"
content="GETBEST Restaurants range from inexpensive and informal lunching" />
<meta name="application-name" content="GETBEST" />
<meta name="msapplication-TileImage" content="https://getbest.co.in/image/cache/catalog/dsfds-144x144.png" />
<link rel="apple-touch-icon" sizes="57x57" href="https://getbest.co.in/image/cache/catalog/dsfds-57x57.png" />
<link rel="apple-touch-icon" sizes="76x76" href="https://getbest.co.in/image/cache/catalog/dsfds-76x76.png" />
<link rel="apple-touch-icon" sizes="114x114"
href="https://getbest.co.in/image/cache/catalog/dsfds-114x114.png" />
<link rel="apple-touch-icon" sizes="120x120"
href="https://getbest.co.in/image/cache/catalog/dsfds-120x120.png" />
<link rel="apple-touch-icon" sizes="144x144"
href="https://getbest.co.in/image/cache/catalog/dsfds-144x144.png" />
<link rel="apple-touch-icon" sizes="152x152"
href="https://getbest.co.in/image/cache/catalog/dsfds-152x152.png" />
<link rel="apple-touch-icon" sizes="167x167"
href="https://getbest.co.in/image/cache/catalog/dsfds-167x167.png" />
<link rel="apple-touch-icon" sizes="180x180"
href="https://getbest.co.in/image/cache/catalog/dsfds-180x180.png" />
<meta name="msapplication-square70x70logo"
content="https://getbest.co.in/image/cache/catalog/dsfds-70x70.png" />
<meta name="msapplication-square150x150logo"
content="https://getbest.co.in/image/cache/catalog/dsfds-150x150.png" />
<meta name="msapplication-square310x310logo"
content="https://getbest.co.in/image/cache/catalog/dsfds-310x310.png" />
<link rel="icon" sizes="128x128" href="https://getbest.co.in/image/cache/catalog/dsfds-128x128.png" />
<link rel="icon" sizes="192x192" href="https://getbest.co.in/image/cache/catalog/dsfds-192x192.png" />
<script type="text/javascript" async>
async function load_jquery_not_exist() {if(!window.jQuery) {var script = document.createElement('script');script.type = "text/javascript";script.async = true;script.src = "https://code.jquery.com/jquery-2.2.4.min.js";document.getElementsByTagName('head')[0].appendChild(script);}}function start_jquery_check() {return load_jquery_not_exist();}(async() => {await start_jquery_check();})();
</script>
<link href="https://getbest.co.in/index.php?route=extension/analytics/progressive_web_application/preloader"
rel="stylesheet" media="screen" />
<script type="text/javascript" async>
async function async_preloader() {if(window.jQuery) {$(document).ready(function(){$(window).load(function(){if ($('#pwa-holder')) {$('#pwa-holder').fadeOut(4919, function() {$('body').removeClass('pwa-loading');});}});});}}function start_async_preloader() {return async_preloader();}(async() => {await start_async_preloader();})();
</script>
</head>
Htmltojson. However, the Flutter Html package can be used to handle this response.