pub fn build_request<R: SimpleRequest>(
            &self,
            request: R,
        ) -> Result<hyper::Request<hyper::Body>, Error> {
            let request_body = request.into_json();

            let mut request = hyper::Request::builder()
                .method("POST")
                .uri(&self.uri)
                .body(hyper::Body::from(request_body.into_bytes()))
                .map_err(Error::http)?;

            {
                let headers = request.headers_mut();
                headers.insert(header::CONTENT_TYPE, "application/json".parse().unwrap());
                headers.insert(
                    header::USER_AGENT,
                    format!("tendermint.rs/{}", env!("CARGO_PKG_VERSION"))
                        .parse()
                        .unwrap(),
                );
            }

            Ok(request)
        }
/// Build a request using the given Tendermint RPC request.
Build a request using the given Tendermint RPC request.
Build a request using the given Tendermint RPC request .
pub fn build_request<R: SimpleRequest>(
            &self,
            request: R,
        ) -> Result<hyper::Request<hyper::Body>, Error> {
            let request_body = request.into_json();
            let mut request = hyper::Request::builder()
                .method("POST")
                .uri(&self.uri)
                .body(hyper::Body::from(request_body.into_bytes()))
                .map_err(Error::http)?;
            {
                let headers = request.headers_mut();
                headers.insert(header::CONTENT_TYPE, "application/json".parse().unwrap());
                headers.insert(
                    header::USER_AGENT,
                    format!("tendermint.rs/{}", env!("CARGO_PKG_VERSION"))
                        .parse()
                        .unwrap(),
                );
            }
            Ok(request)
        }
pub fn build_request < R : SimpleRequest > ( & self , request : R , ) -> Result < hyper :: Request < hyper :: Body > , Error > { let request_body = request . into_json ( ) ; let mut request = hyper :: Request :: builder ( ) . method ( " " ) . uri ( & self . uri ) . body ( hyper :: Body :: from ( request_body . into_bytes ( ) ) ) . map_err ( Error :: http ) ? ; { let headers = request . headers_mut ( ) ; headers . insert ( header :: CONTENT_TYPE , " " . parse ( ) . unwrap ( ) ) ; headers . insert ( header :: USER_AGENT , format ! ( " " env ( " " ) ) . parse ( ) . unwrap ( ) , ) ; } Ok ( request ) }
Build a request using the given Tendermint RPC request.
Build a request using the given Tendermint RPC request .
&self
request
R