SOLVED

Issues Uploading Image via API

Go to solution
Highlighted

Issues Uploading Image via API

I know what I am doing wrong is probably a very simple fix but I can't find it.  See my curl request below

curl.exe -k -X POST -H "Authorization: Bearer 7a15dbf7-bd65-****-****-************:**" -H "Content-Type: application/json"-H "Accept: application/json" -F "folder={\"id\":****, \"type\":\"Folder\"}" -F "name=myFirstApiFile.jpg" -F "file=@D:\*****\*****\*****\header.img" https://***-***-***.mktorest.com/rest/asset/v1/files.json

I receive 701: file is mandatory.  But as you can see file is clearly one of my posted fields.

Tags (3)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Issues Uploading Image via API

figured it out.  needed to drop the "Content-Type" Header

View solution in original post

2 REPLIES 2
Highlighted

Re: Issues Uploading Image via API

figured it out.  needed to drop the "Content-Type" Header

View solution in original post

Highlighted

Re: Issues Uploading Image via API

Hi Chris, I am facing the same issue.

Could you please share the code snippet for uploading an image via API.

Thanks in advance!