/// Builds the POST request headers and body.
Builds the POST request headers and body.
Builds the POST request headers and body .
fn make_req_args(&self, api: Api) -> Result<(HeaderMap, String)> {
        let nonce = self.nonce()?;
        let uri_path = api.inner.uri_path();
        debug_assert!(!api.is_public());
        let body = Body::with_params(nonce, api.inner.params);
        let body = body.urlencode();
        let mut headers: HeaderMap = api.inner.headers;
        if let Some(credentials) = &self.credentials {
            let api_sign = self.api_sign(uri_path, nonce, &body)?;
            headers.insert("API-Key", credentials.api_key().to_owned());
            headers.insert("API-Sign", api_sign);
        }
        Ok((headers, body))
    }
fn make_req_args ( & self , api : Api ) -> Result < ( HeaderMap , String ) > { let nonce = self . nonce ( ) ? ; let uri_path = api . inner . uri_path ( ) ; debug_assert ! ( api is_public ( ) ) ; let body = Body :: with_params ( nonce , api . inner . params ) ; let body = body . urlencode ( ) ; let mut headers : HeaderMap = api . inner . headers ; if let Some ( credentials ) = & self . credentials { let api_sign = self . api_sign ( uri_path , nonce , & body ) ? ; headers . insert ( " " , credentials . api_key ( ) . to_owned ( ) ) ; headers . insert ( " " , api_sign ) ; } Ok ( ( headers , body ) ) }
Builds the POST request headers and body.
Builds the POST request headers and body .
&self
api
Api