fetchAllFromHttp method
Fetch all MetaInfo from various protocols into a single Map.
If url
is not HTTP
or HTTPS
, NonHttpUrlException
will be thrown. Additionally, if url
located neither
HTML nor XHTML resources, ContentTypeMismatchedException
will be thrown.
Optionally, userAgentString can be modified before making request
that allowing to identify as another user agent rather than
default one unless disguiseUserAgent set as true
which
override user agent string from web browser instead.
Once the request got response, it's body content will be html_parser.parse
to Document
directly and build MetaInfo for all
supported protocols.
HTTP response code does not matter in this method that it only
required to retrive HTML content from url
.
Implementation
Future<Map<String, MetaInfo>> fetchAllFromHttp(Uri url) {
return _fetchHtmlDocument(url).then(_buildAllMetaInfo);
}