validation: fix method
This commit is contained in:
parent
88056344f4
commit
dad5a40a09
@ -71,7 +71,7 @@ macro_rules! action{
|
|||||||
let url_raw=format!(concat!("{}/submissions/{}/status/",stringify!($action)),self.base_url,config.0);
|
let url_raw=format!(concat!("{}/submissions/{}/status/",stringify!($action)),self.base_url,config.0);
|
||||||
let url=reqwest::Url::parse(url_raw.as_str()).map_err(Error::ParseError)?;
|
let url=reqwest::Url::parse(url_raw.as_str()).map_err(Error::ParseError)?;
|
||||||
|
|
||||||
self.patch(url).await.map_err(Error::Reqwest)?
|
self.post(url).await.map_err(Error::Reqwest)?
|
||||||
.error_for_status().map_err(Error::Reqwest)?;
|
.error_for_status().map_err(Error::Reqwest)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@ -89,8 +89,8 @@ impl Context{
|
|||||||
self.client.get(url)
|
self.client.get(url)
|
||||||
.send().await
|
.send().await
|
||||||
}
|
}
|
||||||
async fn patch(&self,url:impl reqwest::IntoUrl)->Result<reqwest::Response,reqwest::Error>{
|
async fn post(&self,url:impl reqwest::IntoUrl)->Result<reqwest::Response,reqwest::Error>{
|
||||||
self.client.patch(url)
|
self.client.post(url)
|
||||||
.send().await
|
.send().await
|
||||||
}
|
}
|
||||||
pub async fn get_script(&self,config:GetScriptRequest)->Result<ScriptResponse,Error>{
|
pub async fn get_script(&self,config:GetScriptRequest)->Result<ScriptResponse,Error>{
|
||||||
@ -119,7 +119,7 @@ impl Context{
|
|||||||
.append_pair("ModelVersion",config.ModelVersion.to_string().as_str());
|
.append_pair("ModelVersion",config.ModelVersion.to_string().as_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
self.patch(url).await.map_err(Error::Reqwest)?
|
self.post(url).await.map_err(Error::Reqwest)?
|
||||||
.error_for_status().map_err(Error::Reqwest)?;
|
.error_for_status().map_err(Error::Reqwest)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
Reference in New Issue
Block a user