Next.js API route → 400 "lang" is not allowed (not sending lang)
Unanswered
Lapponian Herder posted this in #help-forum
Lapponian HerderOP
I have an App Router API route (app/api/diagnose/route.ts) that POSTs multipart/form-data to PlantNet. I only append:
images (as Blobs from fetched URLs)
organs=leaf
Yet PlantNet returns:
{"statusCode":400,"error":"Bad Request","message":""lang" is not allowed","validation":{"source":"payload","keys":["lang"]}}
Repo grep shows no lang anywhere. Using Next.js 15 (dev), Node 20.
Questions:
Any chance Next/fetch/FormData is adding lang implicitly?
Best way to inspect/dump the exact multipart body an API route sends?
Thanks!
images (as Blobs from fetched URLs)
organs=leaf
Yet PlantNet returns:
{"statusCode":400,"error":"Bad Request","message":""lang" is not allowed","validation":{"source":"payload","keys":["lang"]}}
Repo grep shows no lang anywhere. Using Next.js 15 (dev), Node 20.
Questions:
Any chance Next/fetch/FormData is adding lang implicitly?
Best way to inspect/dump the exact multipart body an API route sends?
Thanks!