Skip to Content
0
Jul 02, 2020 at 06:43 AM

Ui5 custom header doesnt arrive in the backend

209 Views

I'm trying to send custom headers when I'm calling a create function in the odata service. I'm doing this to differentiate between certain create calls. The headers show up in the network tab in my browser but they arent there when I'm collecting all headers in the odata ABAP code.

Frontend code:

oModel.create("/EntitySet", oEntry, {
  method: "POST",
  headers: {
    "myHeader1" : "value1",
	"myHeader2" : "value2"
  }
});

picture of my network tab

Backend code:

DATA: lo_facade         TYPE REF TO /iwbep/if_mgw_dp_int_facade,
          lt_request_header TYPE tihttpnvp,
          ls_request_header LIKE LINE OF lt_request_header.


    lo_facade ?= /iwbep/if_mgw_conv_srv_runtime~get_dp_facade( ).
    lt_request_header = lo_facade->get_request_header( ).

picture of lt_request_header table results

This is how i saw it in tutorials and it should work.. my question is why are the custom headers not in the request header table results?