mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
Use ureq over reqwest
This commit is contained in:
parent
e052938837
commit
490427f730
3 changed files with 73 additions and 698 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue