async fn request_http(&self, request: serde_json::Value) -> Result<serde_json::Value> {
        // Do simple request/response...
        let mut request = self
            .http_state
            .client
            .post(&self.http_state.api_url)
            .json(&request);
        if let Some(auth_token) = &self.http_state.auth_token {
            request = request.header(AUTHORIZATION, auth_token)
        }
        let response = request.send().await;
        response
            .map_err(|e| {
                if e.is_timeout() {
                    ProtocolError("Request timeout")
                } else {
                    ProtocolError::coerce_static_from_str(&format!("Failed HTTP request: {}", e))
                }
            })?
            .json()
            .await
            .map_err(|e| {
                ProtocolError::coerce_static_from_str(&format!(
                    "Could not parse response as JSON: {}",
                    e
                ))
            })
    }
/// Execute a serialized NashProtocol request via http
Execute a serialized NashProtocol request via http
Execute a serialized NashProtocol request via http
async fn request_http(&self, request: serde_json::Value) -> Result<serde_json::Value> {
        // Do simple request/response...
        let mut request = self
            .http_state
            .client
            .post(&self.http_state.api_url)
            .json(&request);
        if let Some(auth_token) = &self.http_state.auth_token {
            request = request.header(AUTHORIZATION, auth_token)
        }
        let response = request.send().await;
        response
            .map_err(|e| {
                if e.is_timeout() {
                    ProtocolError("Request timeout")
                } else {
                    ProtocolError::coerce_static_from_str(&format!("Failed HTTP request: {}", e))
                }
            })?
            .json()
            .await
            .map_err(|e| {
                ProtocolError::coerce_static_from_str(&format!(
                    "Could not parse response as JSON: {}",
                    e
                ))
            })
    }
async fn request_http ( & self , request : serde_json :: Value ) -> Result < serde_json :: Value > { // Do simple request/response... let mut request = self . http_state . client . post ( & self . http_state . api_url ) . json ( & request ) ; if let Some ( auth_token ) = & self . http_state . auth_token { request = request . header ( AUTHORIZATION , auth_token ) } let response = request . send ( ) . await ; response . map_err ( | e | { if e . is_timeout ( ) { ProtocolError ( " " ) } else { ProtocolError :: coerce_static_from_str ( & format ! ( " " e ) ) } } ) ? . json ( ) . await . map_err ( | e | { ProtocolError :: coerce_static_from_str ( & format ! ( " " e ) ) } ) }
Execute a serialized NashProtocol request via http
Execute a serialized NashProtocol request via http
&self
request
serde_json::Value