cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP HCI - HTTP Adapter with Header Parameter

Former Member
10,081

Hello Experts,

We're trying to consume a Rest API via HTTP Receiver Adapter but, the services has the below two parameters:

- ACCEPT = application/xml

- X-CUSTOM-PARAM = Static GUID provided by the customer

How can we set these parameters in the HTTP Receiver HCI Adapter?

Thank You

Accepted Solutions (1)

Accepted Solutions (1)

MortenWittrock
SAP Mentor
SAP Mentor

Hi Bruno

The Content Modifier step, found in the Message Transformers category of the palette, lets you set headers directly. If the receiver adapter supports headers (which the HTTP adapter does, of course), the headers will be delivered to the recipent along with your request.

Regards,

Morten

Answers (2)

Answers (2)

Sriprasadsbhat
Active Contributor

Hello Bruno.

Have Content Modifier before request reply[ Where you are calling HTTP adapter ] and set these two parameter as header.

Below will give more details

https://uacp.hana.ondemand.com/http.svc/rc/PRODUCTION/93810d568bee49c6b3d7b5065a30b0ff/1/en-US/frame...

Regards,

Sriprasad Shivaram Bhat

Former Member

Many thanks Sriprasad Shivaram Bhat, it helped me a lot, as I Already marked the Morten's answer as a correctly, I unfortunately cannot mark both as a correct. But you helped a Lot!

Former Member
0 Likes

Hi Sriprasad Shivaram Bhat/ Bruno,

I tried with content modifier for passing http header , type header and constant, as Sriprasad said, while selecting data type constant it gives me error, but while giving its type header it gives me Your browser does not support JavaScript or it is turned off, in header payload it will pass http headers names but not value it shows it's value null. so i write Groovy script for it and it works perfectly also in header payload it shos me value that i passed in groovy.

please find groovy script below ,

import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
def Message processData(Message message) {
  // Get the OAuth token value from the properties
  def map = message.getProperties();
  // Set the OAuth authorization credentials
  message.setHeader("Authorization", "bearer ******);
message.setHeader("Content-Type", "application/json");
message.setHeader("tns_id", "***");
message.setHeader("src_sys_id", "***");
message.setHeader("src_ip_address", "***");
  return message;
}