Hi. In api.rs for yew version 0.18, the function "get_response" is:
pubfnget_response(&mutself,callback:Callback<Result<ServerResponse,Error>>)->Result<FetchTask,Error>{leturl=format!("http://api.hostip.info/get_json.php");lethandler=move|response:Response<Json<Result<ServerResponse,Error>>>|{let(meta,Json(data))=response.into_parts();ifmeta.status.is_success(){callback.emit(data)}else{callback.emit(Err(anyhow!("{}: error getting ip from http://api.hostip.info/get_json.php",meta.status)))}};letrequest=Request::get(url.as_str()).body(Nothing).unwrap();FetchService::fetch(request,handler.into())}}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi. In api.rs for yew version 0.18, the function "get_response" is: