API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#API Connect
#Applicationintegration
#APIConnect
 View Only
  • 1.  Issue in accessing Connection and Transfer-Encoding headers from Gatewayscript

    Posted 02/24/20 09:00 AM
    Hi All,
         We are facing an issue in the Gatewayscript
     

    1. Gatewayscript is NOT able to get the "Connection" Header for both Request and Response.
    2. Gatewayscript is NOT able to get the "Transfer-Encoding" Header for both Request and Response.
    Following code is used for iterating through Request Headers:
                                    var request_headers = apim.getvariable('request.headers');
                                      for (var req_header in request_headers) {
                                      }
    Following code is used for iterating through Response Headers:
                                      var response_headers = apim.getvariable('message.headers');
                                      for (var res_header in response_headers) {
                                      }


    ------------------------------
    Anoop K
    ------------------------------


  • 2.  RE: Issue in accessing Connection and Transfer-Encoding headers from Gatewayscript

    Posted 02/24/20 01:14 PM
    Are you sure you can run a for under request_headers like you are doing?
    Why you don´t do:

    apim.getvariable('request.headers.Connection')?


    ------------------------------
    Leandro Takeda
    ------------------------------



  • 3.  RE: Issue in accessing Connection and Transfer-Encoding headers from Gatewayscript

    Posted 02/26/20 01:33 AM
    Edited by Anoop K 02/26/20 01:36 AM
    Hi Leandro,
         I have tried below two options and still getting NULL.

    • var connection = apim.getvariable('request.headers.connection');
    • var tencoding = apim.getvariable('request.headers.transfer-encoding');
    Already we are iterating through the headers (code snippet below) and it WORKS, but CANNOT get the Connection and Transfer-Encoding header.

    var request_headers = apim.getvariable('request.headers');
    for (var req_header in request_headers) {
    header_data[req_header] = request_headers[req_header];
    }

    request.headers.name The value of the original named header of the HTTP request, or the value of the current named header of the root part of a multipart request. The name segment is case-insensitive. Read-only
    I have tried both Case Sensitive and Insensitive for name segment and still did not work.

    Curl command used to send traffic to DP.

    curl -vv -k https://172.16.40.89/porg/sb/api1/ -H "Host: 172.16.40.186:9999" -H "Connection: close" -H "Transfer-Encoding: Chunked" -d "{}"


    ------------------------------
    Anoop K
    ------------------------------



  • 4.  RE: Issue in accessing Connection and Transfer-Encoding headers from Gatewayscript

    Posted 02/26/20 11:07 AM
    Share your .yaml file... (remove any confidential information first)...

    ;)

    ------------------------------
    Leandro Takeda
    ------------------------------