18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Can't receive JSON when using Sahi proxy

anzeoanzeo Members
edited November -1 in Sahi - Open Source
Hi all,


I'm setting up Sahi as our testing tool for our current project, and I've stumbled upon some issues, which I believe all boil down to the same underlying problem.

When using the Sahi proxy I can't receive JSON files/responses from my server, I've looked in the Troubleshooting section and on this forum, but can't seem to find a solution for this.

I've noticed the JSON extension is present in my userdata/config/download_contenttypes.txt, but it seems to no avail.

Could anyone help me out here?


Thanks in advance,

Thomas

Comments

  • Hi

    you may use
    <browser>
    function getResponse($URL){
      var $httpRequest;
      if (window.XMLHttpRequest) { // Mozilla, Safari, ...  
        $httpRequest = new XMLHttpRequest();
      } else if (window.ActiveXObject) { // IE  
        $httpRequest = new_ActiveXObject("Microsoft.XMLHTTP");  
      }  
      $httpRequest.open("HEAD", $URL, false);
      $httpRequest.send(null);
      return $httpRequest;
    }
    </browser>
    

    haven't tested it right.. but it should return a response.. google a little bit for javascript http request, resonse object etc and check if that works...

    and post your code here when you get it to work ;)

    regards
    Wormi
  • anzeoanzeo Members
    Hey Globalworming, thanks for your reply, however I know how to use AJAX (i'm using jQuery's API for that). The problem is whenever I try to execute an AJAX request I get a 204 no content, while there should be data available to me.

    I also can't seem to find any other issues related to JSON and Sahi, but obviously the application runs smoothly without the proxy around it.
  • anzeoanzeo Members
    edited August 2012
    I confirmed the proxy will not let json files pass through, any idea why?

    EDIT: my url contains 'v1' which is removed by the proxy...
Sign In or Register to comment.