Skip to Content
avatar image
Former Member

SAP HCI - HTTP Adapter with Header Parameter

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Feb 24, 2017 at 01:31 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 24, 2017 at 01:45 PM

    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/frameset.html?5e77b59f09e04088b0a01abb1fe4d191.html

    Regards,

    Sriprasad Shivaram Bhat

    Add comment
    10|10000 characters needed characters exceeded

    • 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!

  • Sep 11, 2017 at 02:47 PM

    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;
    }
    

    Add comment
    10|10000 characters needed characters exceeded