resolve_uri should return a two-tuple, so:

(body, mimetype) = resolve_uri(uri)