浏览代码

Fix API info action due to wrong API url

timvisee 7 年之前
父节点
当前提交
35ea5ecf16
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      api/src/action/info.rs

+ 5 - 4
api/src/action/info.rs

@@ -8,6 +8,7 @@ use reqwest::{
     StatusCode,
     StatusCode,
 };
 };
 use reqwest::header::Authorization;
 use reqwest::header::Authorization;
+use serde_json;
 
 
 use api::data::{
 use api::data::{
     Error as DataError,
     Error as DataError,
@@ -109,9 +110,9 @@ impl<'a> Info<'a> {
         data: OwnedData<InfoData>,
         data: OwnedData<InfoData>,
         sig: String,
         sig: String,
     ) -> Result<InfoResponse, InfoError> {
     ) -> Result<InfoResponse, InfoError> {
-        // Get the params URL, and send the request
-        let url = self.file.api_params_url();
-        let mut response = client.get(url)
+        // Get the info URL, and send the request
+        let url = self.file.api_info_url();
+        let mut response = client.post(url)
             .json(&data)
             .json(&data)
             .header(Authorization(
             .header(Authorization(
                 format!("send-v1 {}", sig)
                 format!("send-v1 {}", sig)
@@ -190,7 +191,7 @@ impl InfoResponse {
 #[derive(Fail, Debug)]
 #[derive(Fail, Debug)]
 pub enum Error {
 pub enum Error {
     /// An error occurred while preparing the action.
     /// An error occurred while preparing the action.
-    #[fail(display = "Failed to prepare setting the parameters")]
+    #[fail(display = "Failed to prepare the action")]
     Prepare(#[cause] PrepareError),
     Prepare(#[cause] PrepareError),
 
 
     // /// The given Send file has expired, or did never exist in the first place.
     // /// The given Send file has expired, or did never exist in the first place.