protected Resource toPage(final HttpRequestBase request, final HttpResponse response)
throws IOException, UnsupportedEncodingException {
ContentType contentType = getContentType(response);
ResourceFactory factory = lookupFactory(contentType.getMimeType());
if (factory == null)
factory = lookupFactory(ContentType.WILDCARD.getMimeType());
if (factory == null)
throw MechanizeExceptionFactory.newMechanizeException("No viable page type found, and no wildcard mime type factory registered.");