Hello all,
I am using the HTTP Request Wizard to upload a file along with Json to specify how the end-point will ‘process’ the file. I easily was able to perform the call in Postman, but not able to get a successful POST using the wizard. My issue is how the HTML body is formed. This is the request from Postman:
POST https://dev-irapi.<someurl>:8093//api/pages HTTP/1.1
Authorization: AccessToken ioJF/fQaWjYCqnQB1EwMykUYRsPsLm1S2sxoDNge+cblEHvf8PBNl0UIRa2JlrJfvvmL2BxiNR2Z5ysOLILr4v1oU/bRI0eYlhzZf9WerLzZEP7jCa8Em/veDqfAnum0FfF/def0TkoQfsEwncPsc42uxoZp7/IT9Ezn4THICyT8dLDIh8k/kLaMPaRBqbLQ9Y0Osgx5XPO4dF1BroVRDkmHoLs/rqD4FQon5B4PJWRDp+sBgf1mz2yMSNRKapcNVX/MfRrnMX46V5BTALgfaY43+7nV/zGNTP6HXPzSSlCSSgM70QyeqfsATEkWjiU3lQxMgzM9eswrkCt0dpRJzkX9sy9pErUrWNLyykVj5Hg0L1KZHuInHAmUQqquu+Qt1AKEypJ+5QjGEZWFrx4qjQ==
Postman-Token: 86b466e7-61ed-4a8d-a616-3f0320791ef1
Host: dev-irapi<someurl>:8093
Content-Type: multipart/form-data; boundary=--------------------------543593475052579094938196
Content-Length: 8180
----------------------------543593475052579094938196
Content-Disposition: form-data; name="PageCreateData"
Content-Type: application/json
{"docId": "138419615", "description": "Farm Renewal Rate Calc Pg6"}
----------------------------543593475052579094938196
Content-Disposition: form-data; name="image0"; filename="FarmRenewalRateCalculator.xlsx"
Content-Type: application/pdf
<binary data goes here>
----------------------------543593475052579094938196--
However, in the HTTP Request Wizard, I get this:
POST https://dev-irapi.<someurl>:8093/api/pages/ HTTP/1.1
Authorization: AccessToken ioJA/fQaWjYCqnQB1EwMyqg8IAXRnkli2QWJgnbCUPVbs0ygMzhj6m7HLDz+mHQYaLD7jrB72D+nxj2bvvbP9pdXNtVP+3HYpqgbo1/3MViKp4mSfrTbYy5D3K1mszKcei9plSu2xeQ+RZHVMnFjZal9RKOTKg4bg8+mPbcXvdSKdApwSw5omIK+0WunysUa3O44QcFhzCZi8tUF8Dwd9gftBEcC4occj/SyUPabedBJaXN5/CuRKBdosLqejCskn+xDQ7PRJ6X+ux3WYsmpgxNEpRj2lEDmfSYeqoRc2QWsGjfxfU2aeSJxsGpuJN2JD1ByKVJ542mNM1sgcCjIutDnnsHzVqI2zUBZhJjHncJz8/5BOq2RajLLSRLxFmtTPx356saLPkozSTr0pbvDdQ==
Accept: */*
User-Agent: RestSharp/106.15.0.0
Content-Type: multipart/form-data; boundary=---------3532A6F5-A8D1-430A-B915-E9FA4B53F4BE
Host: dev-irapi.<someurl>:8093
Content-Length: 8142
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
-----------DC9FC71D-FB70-45CC-888F-4415E18D7430
Content-Disposition: form-data; name="PageCreateData"
{"docId": "138419615", "description": "Farm Renewal Rate Calc Pg6"}
-----------DC9FC71D-FB70-45CC-888F-4415E18D7430
Content-Disposition: form-data; name="image0"; filename="FarmRenewalRateCalculator.xlsx"
Content-Type: application/octet-stream
<binary goes here>
-----------DC9FC71D-FB70-45CC-888F-4415E18D7430--
Here are the setting in the Wizard:
For the most part, the main difference is the Content-Type of the different form fields or “Parameters”. The first form part should be “application/json” and the binary file type should be “application/pdf”.
In the Wizard, on the other hand, the first form part that is “application/json” in Postman is not set at all, and the second binary file that is “application/pdf” in Postman is set to “application/octet-stream” in the wizard.
I think that may be the issue, but I really need a hand to figure out how to use the Wizard properly to define this request.
Any help would be greatly appreciated. Thanks!!