locked
Hoew to Get HTTP Headers in HTML using Javascripit from SiteMinder

    Question

  • SiteMinder HTTP headers unable to fetch using javascripit in HTML,I'd like to print the HTTP headers to the screen to confirm that SM_user is being sent as an HTTP_header.

    Code:
    var req = new XMLHttpRequest();
    req.open('GET', document.location, false);
    req.send(null);
    var headers = req.getAllResponseHeaders().toLowerCase();
    alert(headers);

    Is there a way to return the entire list of HTTP response headers? 
    Many thanks,
    Monday, May 11, 2015 4:52 PM

All replies

  • When you say you want to confirm it - do you just need confirmation that it's working, or do you need it in code? I would just recommend that you use Fiddler to inspect the response.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, May 11, 2015 7:28 PM
    Moderator
  • Thanks Matt for reply.

    Yes we need it in code, we able to see the SM_user is being sent as an HTTP_header using C# code,But we need SM_User using Javascripit or Jquery,Is there any alternate Javascripit or Jquery code to get HTTP response headers


    Tuesday, May 12, 2015 6:04 AM
  • I'm concerned that you aren't getting all of the response headers from this line:

    var headers = req.getAllResponseHeaders().toLowerCase();

    What exactly is being returned?


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Tuesday, May 12, 2015 4:02 PM
    Moderator