Skip to content

Getting a status code 404 when fetching private files #56

Answered by stevedylandev
Akinbola247 asked this question in Q&A
Discussion options

You must be logged in to vote

I took a closer look at your original code and hte curl request and I think you might need to tweak a few things to make a valid request. In the body of the of the request you're sending to Pinata you're not passing in your own gateway url, and instead it's the example. We also want to dynamically pass in the date vs hard coding it in. At the very end of the code you're sending something that doesn't exist on the response, it should just be responseData.data per the docs. Can you try using this code instead and make sure you have NEXT_PUBLIC_GATEWAY_URL set with your own gateway in the format of my-example-gateway.mypinata.cloud?

export async function POST(req: Request) {
  try {
    // G…

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@stevedylandev
Comment options

@Akinbola247
Comment options

@Akinbola247
Comment options

@stevedylandev
Comment options

Answer selected by Akinbola247
@Akinbola247
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants