API Connect

 View Only
Expand all | Collapse all

Propagate / Inhibit / Create Headers

  • 1.  Propagate / Inhibit / Create Headers

    Posted Wed February 21, 2024 06:31 PM

    HI,

    We are developing in API Connect Base Edition SaaS environment.

    I would like to request information on how to do the following:

    1. Propagating headers from the original request to the target URL of the invoke policy
    2. Inhibiting  headers in the original request from propagating to the target URL of the invoke policy
    3. Creating new headers on the request to be set to the target URL of the invoking  

    Thank you

    Paul



    ------------------------------
    Paul Dango
    ------------------------------


  • 2.  RE: Propagate / Inhibit / Create Headers

    Posted Thu February 22, 2024 04:58 AM

    Hi Paul, 

    You can adjust which headers are propagated to the target url using the header control property on the invoke policy - this can either be an allow list or a block list  - see https://www.ibm.com/docs/en/api-connect/saas?topic=invoke-configuring-policy-datapower-api-gateway for details.

    For adding additional headers prior to the invoke I've typically used a set-variable policy (https://www.ibm.com/docs/en/api-connect/saas?topic=variable-configuring-set-policy-datapower-api-gateway) setting the value of `message.headers.newheader` to have the content I need. I have an example of using this to add the headers required for a token request in https://gist.github.com/rickymoorhouse/95ca5237bf93f31c2d1629b94662882d#file-ibm-cloud-function-yaml-L24-L37

    Hope this is useful 

    Thanks


    Ricky



    ------------------------------
    Ricky Moorhouse
    IBM API Connect Cloud Architect
    ------------------------------