Question
Adqura
GB
Last activity: 8 Sep 2018 11:13 EDT
Is it possible to remove the Content-Type (text;charset=UTF-8) in a 401 Unauthorized REST Service Response
Hi,
One of our clients consuming our REST service have requested that we remove the Content-Type (text;charset=UTF-8) when there is an authorization failure (401) from the Response as it doesn't actually contain any body.
Is this possible?
Thanks.
regards,
Suraj
Kind
***Edited by Moderator Marissa to update platform capability tags****
-
Like (0)
Aravind_CG C -
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Instellars
IN
Hi Suraj,
I don't think this is supported out of the box. It might be possible by using an activity to get the response and then setting it accordingly.
Adqura
GB
If there is a auth failure - do you even get an opportunity to invoke an activity? I presumed it was handled directly by Pega. It would be great if you/someone can guide on how to invoke an activity when there is a auth failure.
Pegasystems Inc.
IN
Yes,you are correct @SurajAmin.If we are consuming then we can handle this using pyHttpResoponse code property's value.
Adqura
GB
Not sure I understand. I checked pyHTTPResponseCode and it looks like its used to set the HTTP Response code (200, 401, etc) - I was looking into how I can skip the content-type in the response when there is a 401 (auth failure)
Areteans
AU
Hi Suraj,
Please check the content tyoe field in reponse tab of our rest rule. This issue mainly happens if the type is text/html.
If you are sending JSON as response, try selecting application/json and execute.
Hope this helps you.
Thanks,
Divya Sri Padarthy
Adqura
GB
When I add a Security-Error condition to the response (see attached screenshot) - I can't seem to leave the Content type field blank even though there is nothing mapped in the Message data (section below)
-
Florian Weber Matt Geiger HEMAVATHI V HEMAVATHI V Anand Yalla and 3 More
Areteans
AU
you should not leave it as blank.
Based on response type, that has to be mapped.
Adaps
IN
Below link might help you
CollabPartnerz
IN
Hi,
Could you please explain why do you want to remove ?