POST https://ipfs.infura.io:5001/api/v0/add?stream-channels=true&progress=false 401 (Unauthorized)
External Image
I’m getting this error while trying to upload a file to IPFS. I have no idea where the error lies.
This is the GitHub repo of complete code
https://github.com/abhijit69-ui/nft_marketplace
3 Likes
radu
April 13, 2023, 7:45am
#2
Hi @abhijit69-ui and welcome to the community.
It seems you are not authenticating your request, hence the 401 unauthorized error. Please use your project Id and project secret to authenticate. You can use the below as an example:
curl "https://ipfs.infura.io:5001/api/v0/add?pin=false" \
-X POST \
-u "PROJECT_ID:PROJECT_SECRET" \
-H "Content-Type: multipart/form-data" \
-F file=@"/sample-result.json"
2 Likes
system
Closed
May 11, 2023, 2:18pm
#3
This topic was automatically closed after 30 days. New replies are no longer allowed.