Get Data
Get Data Function (Task)
Task<> IPFS.IpfsFunctionLibrary.GetData(
IpfsHttpGatewayConfig ipfsHttpGatewayConfig,
IpfsAddress ipfsAddress)
This function gets data from the IPFS network for the specified CID/Path. This function requires inputs as follows:
ipfsHttpGatewayConfig
: Holds the URL of the gateway to send the request to.ipfsAddress
: Holds the CID and path of the file on IPFS network.
The returned Response is a Task
that holds data such as headers, status code, and body of the response of the HTTP
request.
Task<(bool success, string errorMessage, HttpResponse response, byte[] data)>
info
If success
is true
that only means that the response from the IPFS network was successful only.
If successful, returns the data
which is an array of bytes.
Get Data Function (Delegate)
void IPFS.IpfsFunctionLibrary.GetData(
IpfsHttpGatewayConfig ipfsHttpGatewayConfig,
IpfsAddress ipfsAddress,
IpfsGetDataDelegate responseDelegate)
This is a wrapper function for the async implementation. It exists to provide the same functionality but using a delegate for handling responses.
delegate void IpfsGetDataDelegate(
bool success,
string errorMessage,
HttpResponse response,
byte[] data)