IBM Verify

 View Only
Expand all | Collapse all

How to read response headers while using HttpClient api in ISAM

  • 1.  How to read response headers while using HttpClient api in ISAM

    Posted Tue November 28, 2023 12:35 AM

    Hi All,

    I am trying to read headers from the response. Below is the code which is working for reading response body

    May I know the api method to read the headers from the response(response headers)

     importClass(Packages.com.ibm.security.access.httpclient.HttpClient);
      importClass(Packages.com.ibm.security.access.httpclient.HttpResponse);
      importClass(Packages.com.ibm.security.access.httpclient.Headers);

    response = HttpClient.httpPost(restURL , header, body, null, null, null, null, null);

    response.getBody() --> getting response body 

    Looking for the method to read the response from headers like above

    Thanks

    Sudheer



    ------------------------------
    Sudheer Puvvada
    ------------------------------


  • 2.  RE: How to read response headers while using HttpClient api in ISAM

    Posted Wed November 29, 2023 01:26 AM

    Download the javadoc from the admin UI under System -> File Downloads.

    Look for access_control -> doc -> ISVA_javadoc.zip

    Unzip it, load in a browser and read it all there. The response object has methods for accessing all the headers.

    Also, use HttpClientV2 as it is a better underlying implementation and should be a direct swap for the original HttpClient.



    ------------------------------
    Shane Weeden
    IBM
    ------------------------------