getblockheader Method
Returns the corresponding block header information according to the specified script hash or index.
The usage of this method is as same as getblock
. The only difference is that getblockeader
gets the block header and getblock
gets the complete block.
Parameter Description
hash | index: The block script hash or index (i.e. block height=number of blocks - 1).
verbose: Optional, the default value is false.
When verbose is false, serialized information of the block is returned in a hexadecimal string. If you need the detailed information, use the SDK for deserialization.
When verbose is true or 1, detailed information of the block is returned in Json format.
Example
Example 1 - invoke with block hash
Request body:
or
Response body:
Example 2 - 获取 JSON 格式的区块信息
请求正文:
或
响应正文: