Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modify response headers in SEGW Odata service

I have an OData Service Created with SEGW. In my DPC_EXT class I want to modify the response headers.

in other words, before the entityset is returned I want to add my custom header to the response, so that the front-end can handle those custom headers.

I found only the lo_facade->get_request_header( ) method, but that didn't help me because those are the request headers.

How can I add a custom header to the HTTP response of my entityset?

like image 337
Kevin Mueller Avatar asked Nov 26 '25 21:11

Kevin Mueller


1 Answers

I figured it out. One should add following code in the redefinition of entityset:

DATA: ls_header TYPE ihttpnvp.
ls_header-name = 'ZISM_WARN_MSG'.
ls_header-value = iv_message.
set_header( is_header = ls_header ).
like image 195
Kevin Mueller Avatar answered Nov 28 '25 11:11

Kevin Mueller



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!