Documente Academic
Documente Profesional
Documente Cultură
Description
Name/value pair as header parameter of the HTTP
response.
We can add the header in our data provider class using the following code:
data: ls_header TYPE ihttpnvp.
ls_header-name = 'Access-Control-Allow-Origin' .
ls_header-value = '*'.
/iwbep/if_mgw_conv_srv_runtime~set_header( ls_header ).
This sets the parameter in the response header.
Custom
Header
added
Sometimes, services may return confidential or person related data, where the User Agent is
involved, and this data might implicitly be cached depending on the user's setting. To remove
this behavior, SAP NetWeaver Gateway can instruct the User Agent not to cache specific
data if needed. To avoid caching of confidential data, all GET methods returning such data
must set the Cache-Control-Header. This again can be set using the same SET_HEADER
method.
data: ls_header type ihttpnvp.
ls_header-name = 'Cache-Control'.
ls_header-value = 'no-cache, no-store'. set_header( ls_header ).
ls_header-name = 'Pragma'.
ls_header-value = 'no-cache'. set_header( ls_header ).