AnsweredAssumed Answered

cURL Format - Posting a File

Question asked by Scott V on Apr 15, 2018
Latest reply on Aug 22, 2018 by michibell

I'm trying to post a zipped file to an API via cURL. I can do this via Postman no issue. Here's the "code" from Postman:

 

curl -X POST \

  http://1.234.457.890:8098/assetingestion/v1/asset/upload \

  -H 'Cache-Control: no-cache' \

  -H 'Content-Type: multipart/form-data' \

  -H 'Postman-Token: b4d543fb-747b-479f-a416-97a85436e2e6' \

  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \

  -F 'file=@C:\Users\me\Desktop\JSON\upload.zip'

 

I downloaded Mr. Decorte's FM16 _cURL_CF example file and attempted to modify it to my file to develop a working strawman to transfer over to my production tool. Updated $cURL_options to this:

 

_cURL_request ( "POST" ) &

_cURL_header ( "Accept" ; "multipart/form-data" ) &

_cURL_dump_header ( "header" )

 

Fails to post. There's no authroization (yet) - just trying to get the file moving.

 

The desired scenario is having a zip file in a container field, post it. Next transaction, zip file, post, etc. I could have the files in a folder on the server as well - either works.

 

Thanks!

 

fb1.JPG

 

fb2.JPG

Outcomes