Use ureq over reqwest

This commit is contained in:
Richard Feldman 2021-04-05 22:11:48 -04:00
parent e052938837
commit 490427f730
3 changed files with 73 additions and 698 deletions

View file

@ -48,11 +48,12 @@ pub fn roc_fx_putLine(line: RocStr) -> () {
#[no_mangle]
pub fn roc_fx_httpGetUtf8(url: RocStr) -> RocStr {
let body = reqwest::blocking::get(unsafe { url.as_str() })
let body = ureq::get(unsafe { url.as_str() })
.call()
.unwrap_or_else(|err| todo!("Report this HTTP error: {:?}", err));
let str = body
.text()
.into_string()
.unwrap_or_else(|err| todo!("Report this body.text() error: {:?}", err));
RocStr::from_slice(str.as_bytes())