Connect-REST content-type: "application/JSON" not setting in the out going request
In the Connect-REST rule POST header is set to Content-Type: "application/json".
But in the captured Connect REST request has override the header Content-Type with "text/plain" as follows.
Wed Apr 04 03:22:41 CDT 2018:INFO:--8dZGfHO7gPBZCjmgYUr04__I9QM0vQR
Content-Disposition: form-data; name="PostData"
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: form-data; name="attachments"; filename="Citi_leftmenubar_bg.jpg"
Note: Connect-REST Request is build with attachments
Is there any other option to set header value as "application/json" apart from adding header in the Connector rule.
***Edited by Moderator Marissa to update Content Type from Discussion to Question; update SR details***
This issue is a bug in Pega 7.2 code base[SR-C25702]. This is fixed in 8.1 as per the SR update.
So we have removed message data from connector rule and add that JSON part into pyRequestAttachment page as the solution. In there we can provide the content type also as a parameter. And multi-part request also built in the expected format.
Keep up to date on this post and subscribe to comments
- Why REST Service cannot parse json request if Content-Type header is equal to application/json;charset=UTF-8.
- Pega setting content-length value incorrectly in Connect-Rest in case of any special characters in the request data
- How to set Content-type as application/json;charset=UTF-8 in a failed authentication response at service package level
- Multipart json request for a connect-rest
- In PEGA 7.1.10 wizard generated Connect-Rest json request containing the previous attribute