on 2021 Nov 16 10:36 AM
Hi Experts,
Using PCo 15.4.3 Patch 19 and trying to make a multipart/form-data request but not getting the expected result.
We have several tests performed using other methods that i want to replicate using PCo as this has access to the source files we need to upload.
Using Curl we have this request;
curl -v -F "solarcell-image=@img/PLMK/$img_K" "$S3_SERVICE"
So solarcell-image would be the form name, @img... is the filename and $S3... is the target.
Using NodeJS and Needle we have this request;
needle.post('$S3_SERVICE', {'solarcell-image': { file: img/PLMK/$img_K', content_type: 'application/octet-stream' } }, { multipart: true, username: '***', password: '***', proxy: '***'})
So same basic request as the Curl, this time specifying a proxy.
Both of the above work, however using PCo I cannot get the request to send the required format.
Using PCo we have the Endpoint, proxy and credentials defined - this is all working, however when using the generated Multipart variables we do not load the files to the target.
The standard FormName, FilePath and ContentType variables are populated (FormName = solarcell-image)
When testing we can see some of the Raw Request as follows;
Content-Length: 3622882
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
--:UWS Boundary 0f39fc93-92ca-4d08-8282-106c21e9d1d2:...
--:UWS Boundary 0f39fc93-92ca-4d08-8282-106c21e9d1d2:--
So the content-length is the actual file size - which I assume means the file has been sent, what I cannot view or confirm is if the 'solarcell-image' FormName is sent correctly.
Can anyone confirm how to correctly structure the PCo request to match either the Curl or NodeJS format that is working correctly?
Thanks, Scott.
Request clarification before answering.
User | Count |
---|---|
3 | |
3 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.