Need To Replicate a cURL call With CFHTTP
Hello:
I need to replicate the following cURL call, which uses a multipart/form-data header and form fields:
curl -L -R POST "https://api.XXXXXXXX.com/api/v1/academic_success/sync/enrollment" \
-H "Authorization: Bearer <access_token>" \ # Generated OAuth2 token request
-H "Content-Type: multipart/form-data" \
-F "input_type=CSV" \
-F "input_data=@enrollment_upload.csv" \ # Path to CSV file. Include '@' before path.
-F "dry_run=false" \ # Set to true when testing
-F 'drop_not_passed_enrollments=true' \ # only enabled when dry_run = false
CFHTTP does not allow specifying form fields for multi-part data. I assume I'd have to code a header that included the form fields as part of the body along with the data, but am unclear on how to do this. We are currently production with CF 2018.
Thanks.
Gerry, Pace University
