type needs to be URIEncoded as well.