I have an app which calls a adapter and which has a procedure that connects to rest service to fetch me the required data and I am sending the data back to app.
The request body comes fine to app. But how do I send headers that I receive from rest services to app .i.e I want my adapter to send the headers that it receive from rest service to my app.
I am using the following adapter code.
function getFeed(tag,json) {
var input = {
method : 'post',
returnedContentType : 'json',
path : 'myservice',
headers : {'head1': 'value'},
body: {
contentType: 'application/json' ,
content: json
},
};
return WL.Server.invokeHttp(input);
}
The response JSON that reaches the client (the result of WL.Server.invokeHttp(input)
), contains a key "responseHeaders
".
This responseHeaders is a relay of the headers that were received from the backend.