We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GET /tx/:txid
I've defined a Rust struct that matches the specified transaction format. It appropriately derives an implementation of serde::Deserialize.
serde::Deserialize
The URL for my request is defined as
let url = format!("http://127.0.0.1:5000/regtest/api/tx/{txid}");
The headers are set to Accept application/json.
Accept application/json
The call returns a 200 response status, however, because the returned body is HTML, the following deserialization effort fails:
200
let tx: TxInfo = serde_json::from_slice(&response.body)?;
ERROR: "Error(\"expected value\", line: 1, column: 1)"
"Error(\"expected value\", line: 1, column: 1)"
Here's the full response from the API call:
STATUS: 200 HEADERS: [HttpHeader { name: "x-powered-by", value: "Express" }, HttpHeader { name: "content-type", value: "text/html; charset=utf-8" }, HttpHeader { name: "content-length", value: "519" }, HttpHeader { name: "etag", value: "--" }, HttpHeader { name: "date", value: "Mon, 06 May 2024 --" }, HttpHeader { name: "connection", value: "close" }] BODY: <!DOCTYPE html><head><meta charset="utf-8"><title>Block Explorer</title><meta property="og:title" content="Block explorer"><meta name="description" content="Esplora Block Explorer"><base href="/"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="shortcut icon" type="image/png" href="img/favicon.png"><link rel="stylesheet" href="bootstrap.min.css"><link rel="stylesheet" href="style.css"></head><body lang="en" dir="ltr"><div id="explorer"></div><script src="app.js" async></script></body>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I've defined a Rust struct that matches the specified transaction format. It appropriately derives an implementation of
serde::Deserialize
.The URL for my request is defined as
The headers are set to
Accept application/json
.The call returns a
200
response status, however, because the returned body is HTML, the following deserialization effort fails:ERROR:
"Error(\"expected value\", line: 1, column: 1)"
Here's the full response from the API call:
The text was updated successfully, but these errors were encountered: