cancel
Showing results for 
Search instead for 
Did you mean: 

Consuming REST Service without message body in response

markbernabe
Active Participant
0 Kudos

Hi experts,

There is a REST web service that we need to consume in HCI via GET method. If there's no error, only HTTP 204 is returned in a Header field called 'status' - no response payload /message body obviously. The only time that there will be response body is if there's an error like HTTP 503 which can also be found in the same 'status' Header field plus an error message in the response body.

The problem is we need to return a response to the consumer (Sender). But since there's no response message body when the web service returns HTTP 204, how can we access the 'status' Header field and maybe integrate it in a body created via a Content Modifier?

Appreciate any inputs. Thanks!

Former Member
0 Kudos

Hi Mark,

How did you consume the web service from within the Integration Process box in your iflow?

Is there a connector I can use to consume a web service from within integration box ?

I am looking to consume from a cloud based webservice and use the retrieved data to push to another cloud based web service.

Please suggest

markbernabe
Active Participant

Accepted Solutions (1)

Accepted Solutions (1)

MortenWittrock
Active Contributor
0 Kudos

Hi Mark

Adding the contents of your status header to the message body in a Content Modifier step is easy: Just insert ${header.status}

However, all headers are removed, unless you actively add them to the list of allowed headers. In order to do that, click somewhere in the background of your Integration Flow, choose the Runtime Configuration tab and add "status" to the Allowed Header(s) field.

Regards,

Morten

markbernabe
Active Participant
0 Kudos

Thanks for the info Morten! Was also able to get the header details using ${in.headers}

MortenWittrock
Active Contributor

No problem. And yes, in.header.x, in.headers.x, header.x and headers.x are all synonymous. I've blogged about the Simple expression language, if you'd like to know more.

markbernabe
Active Participant
0 Kudos

Thanks for sharing! Awesome stuff.

Answers (0)