[SOLVED] How to check ipfs hash in image/video/audio using Moralis

Hi,

how to check ipfs hash in image/video/audio using Moralis?

i have found below solution using fetch function.

let contentType = await fetch(imageUrl)
  .then(response => {
    return response.blob().then(blob => {
      return {
        contentType: response.headers.get("Content-Type"),
        raw: blob
      }
    })
  })
  .then(data => {
    return data.contentType
  })

I have try this solution using httpRequest but error show response.blob() is not function.

how to achiev this using httpRequest or any other solution.

I would be so grateful if you help to sortout this.

If you are able to read the headers then you should be able to get that information. You can try to make a head request instead of a get request.

hi @cryptokid thanks for reply ,

Please give example idea about head request in cloud function so i will check on this direction.

As i am understanding you will be talk about this setting-headers? or other method https://v1docs.moralis.io/moralis-dapp/cloud-code/httprequest#setting-headers

no, I mean about reading the header for the response that you get from a head request, you will find out how to make a get or post request, a head request should be similar

1 Like

Thanks @cryptokid

I have got solution.

1 Like