idk some wip shit

This commit is contained in:
SpikeHD
2022-07-13 23:43:55 -07:00
parent bae193050f
commit aa10a908ad
4 changed files with 53 additions and 7 deletions

View File

@@ -49,7 +49,8 @@ fn main() {
downloader::stop_download,
lang::get_lang,
lang::get_languages,
web::valid_url
web::valid_url,
web::web_get
])
.run(tauri::generate_context!())
.expect("error while running tauri application");

View File

@@ -15,4 +15,10 @@ pub(crate) async fn valid_url(url: String) -> bool {
let response = client.get(url).header(USER_AGENT, "cultivation").send().await.unwrap();
response.status().as_str() == "200"
}
#[tauri::command]
pub async fn web_get(url: String) -> String {
// Send a GET request to the specified URL and send the response body back to the client.
query(&url).await
}