Error 5400: Bad request: Error parsing form fields

I want to upload an image to cloudfare image but I’m getting this error: ‘ERROR 5400: Bad request: Error parsing form fields’
I use this code :
curl --request POST
–url https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/images/v1
–header ‘Authorization: Bearer <API_TOKEN>’
–form ‘url=https://[user:[email protected]]example.com/<PATH_TO_IMAGE>’
–form ‘metadata={“key”:“value”}’
–form ‘requireSignedURLs=false’
Thank you

HI, can you provide specific example without credentials?

here is my code:
curl --location --request POST ‘https://api.cloudflare.com/client/v4/accounts/<Account_Id>/images/v1’
–header 'Authorization: Bearer ’
–form ‘[email protected]"/Users/elouadmin/Downloads/Bitik.png"’
–form ‘requireSignedURLs=“false”’
Thanks

it should be:

curl --location --request POST 'https://api.cloudflare.com/client/v4/accounts/<Account_Id>/images/v1'
–header 'Authorization: Bearer <TOKEN>'
–form '[email protected]"/Users/elouadmin/Downloads/Bitik.png"'
–form 'requireSignedURLs="false"'

btw you can avoid specifying requireSignedURLs, it is false by default.

1 Like

This topic was automatically closed after 15 days. New replies are no longer allowed.