I'm unable to submit Dropbox API request from YML Gitlab Pipeline using PowerShell (Windows runner). The API requires to pass a JSON as a header parameter and encoding that JSON into YML Gitlab Pipeline doesn't work:
`--header "Dropbox-API-Arg:{\"path\":\"/$BUILD_FILENAME\"}"The full script step is below as it's now defined in YML:
- C:\Windows\System32\curl.exe -X POST https://content.dropboxapi.com/2/files/upload --header "Authorization:Bearer $DROPBOX_TOKEN" --header "Content-Type:application/octet-stream" --header "Dropbox-API-Arg:{\"path\":\"/$BUILD_FILENAME\"$BUILD_FULLFILENAMEThe response error is below:
Error in call to API function "files/upload": HTTP header "Dropbox-API-Arg": could not decode input as JSONcurl: (3) Port number ended with '\'
I can execute the command above in Windows PowerShell on the same PC where the runner is without any issues:
curl -X POST https://content.dropboxapi.com/2/files/upload --header "Authorization: Bearer XXX" --header "Dropbox-API-Arg: {\"path\": \"/README.md\"}" --header "Content-Type: application/octet-stream" --data-binary @README.md
I don't have the opportunity to debug and monitor the actual HTTP request sent by the pipeline, is it possible to get more details from the dropbox API side to check what is wrong with the request? More details on the error above or the actual content of the request (including headers) would definitely help. How can I encode the JSON properly so it can be executed and pass to the CURL as expected?