Excon is expecting a string, by adding the .to_s Excon will also accept a URI class.