<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Running POST request trough the proxy in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Running-POST-request-trough-the-proxy/m-p/1170515#M5750</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there.&lt;/P&gt;&lt;P&gt;Im currently writing a script to access some featuyres of the QlikSense repository API and im therefor using the REST API.&lt;/P&gt;&lt;P&gt;I have succsessfully baan able to run "GET" coammands trough the proxy by suppling a Password for the account running the script. However i cannot get POST commands to run. When i do, i get a message that say that i need to run a GET command befor running my POST. This is confirmed by the documentation &lt;A href="https://help.qlik.com/en-US/sense-developer/2.2/Subsystems/RepositoryServiceAPI/Content/RepositoryServiceAPI/RepositoryServiceAPI-Example-Connect-POST-Proxy.htm" title="https://help.qlik.com/en-US/sense-developer/2.2/Subsystems/RepositoryServiceAPI/Content/RepositoryServiceAPI/RepositoryServiceAPI-Example-Connect-POST-Proxy.htm"&gt;https://help.qlik.com/en-US/sense-developer/2.2/Subsystems/RepositoryServiceAPI/Content/RepositoryServiceAPI/RepositoryS…&lt;/A&gt;. The problem is that it doesnt work. I run my GET command i get some data from the API, and then u run the POST, but then i get standard HTML (the page that say I need to run a GET command first). So how to do it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c#" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14655632209801417" jivemacro_uid="_14655632209801417" modifiedtitle="true"&gt;
&lt;P&gt;$key = "ABCDEFGHIJKLMNOP"&lt;/P&gt;
&lt;P&gt;$password = "mypassword"&lt;/P&gt;
&lt;P&gt;$&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;taskid =&amp;nbsp; "taskid..."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;$url = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://senseserver/qrs/task/" rel="nofollow" target="_blank"&gt;http://senseserver/qrs/task/&lt;/A&gt;&lt;SPAN&gt;" &amp;amp; $taskid &amp;amp; "/start/"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;$objHTTP = ObjCreate("Msxml2.XMLHTTP.6.0")&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//GET request&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;$objHTTP.open("GET","&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://" rel="nofollow" target="_blank"&gt;http://&lt;/A&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;senseserver&lt;/SPAN&gt;/qrs/about/?Xrfkey=" &amp;amp; $key, False,@UserName,$password)&lt;/P&gt;
&lt;P&gt;$objHTTP.setRequestHeader("X-Qlik-Xrfkey",$key)&lt;/P&gt;
&lt;P&gt;$objHTTP.send()&lt;/P&gt;
&lt;P&gt;ConsoleWrite("Sense API Output: " &amp;amp; $objHTTP.responseText &amp;amp; @CRLF)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//POST Request&lt;/P&gt;
&lt;P&gt;$objHTTP.open($metod,$url &amp;amp; "?Xrfkey=" &amp;amp; $key, False,@UserName,$password)&lt;/P&gt;
&lt;P&gt;ConsoleWrite($url &amp;amp; "?Xrfkey=" &amp;amp; $key &amp;amp; @CRLF)&lt;/P&gt;
&lt;P&gt;$objHTTP.setRequestHeader("X-Qlik-Xrfkey",$key)&lt;/P&gt;
&lt;P&gt;$objHTTP.send()&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;$data = $objHTTP.responseText&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;ConsoleWrite("Sense API Output: " &amp;amp; $objHTTP.responseText &amp;amp; @CRLF)&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first GET request works fine. The POST, fails.&lt;/P&gt;&lt;P&gt;If i run the same URLs using POSTMAN (a Chrome-plugin REST client). Post works directly without any issues.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Jun 2016 12:59:49 GMT</pubDate>
    <dc:creator>gustavgager</dc:creator>
    <dc:date>2016-06-10T12:59:49Z</dc:date>
    <item>
      <title>Running POST request trough the proxy</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Running-POST-request-trough-the-proxy/m-p/1170515#M5750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there.&lt;/P&gt;&lt;P&gt;Im currently writing a script to access some featuyres of the QlikSense repository API and im therefor using the REST API.&lt;/P&gt;&lt;P&gt;I have succsessfully baan able to run "GET" coammands trough the proxy by suppling a Password for the account running the script. However i cannot get POST commands to run. When i do, i get a message that say that i need to run a GET command befor running my POST. This is confirmed by the documentation &lt;A href="https://help.qlik.com/en-US/sense-developer/2.2/Subsystems/RepositoryServiceAPI/Content/RepositoryServiceAPI/RepositoryServiceAPI-Example-Connect-POST-Proxy.htm" title="https://help.qlik.com/en-US/sense-developer/2.2/Subsystems/RepositoryServiceAPI/Content/RepositoryServiceAPI/RepositoryServiceAPI-Example-Connect-POST-Proxy.htm"&gt;https://help.qlik.com/en-US/sense-developer/2.2/Subsystems/RepositoryServiceAPI/Content/RepositoryServiceAPI/RepositoryS…&lt;/A&gt;. The problem is that it doesnt work. I run my GET command i get some data from the API, and then u run the POST, but then i get standard HTML (the page that say I need to run a GET command first). So how to do it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c#" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14655632209801417" jivemacro_uid="_14655632209801417" modifiedtitle="true"&gt;
&lt;P&gt;$key = "ABCDEFGHIJKLMNOP"&lt;/P&gt;
&lt;P&gt;$password = "mypassword"&lt;/P&gt;
&lt;P&gt;$&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;taskid =&amp;nbsp; "taskid..."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;$url = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://senseserver/qrs/task/" rel="nofollow" target="_blank"&gt;http://senseserver/qrs/task/&lt;/A&gt;&lt;SPAN&gt;" &amp;amp; $taskid &amp;amp; "/start/"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;$objHTTP = ObjCreate("Msxml2.XMLHTTP.6.0")&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//GET request&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;$objHTTP.open("GET","&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://" rel="nofollow" target="_blank"&gt;http://&lt;/A&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;senseserver&lt;/SPAN&gt;/qrs/about/?Xrfkey=" &amp;amp; $key, False,@UserName,$password)&lt;/P&gt;
&lt;P&gt;$objHTTP.setRequestHeader("X-Qlik-Xrfkey",$key)&lt;/P&gt;
&lt;P&gt;$objHTTP.send()&lt;/P&gt;
&lt;P&gt;ConsoleWrite("Sense API Output: " &amp;amp; $objHTTP.responseText &amp;amp; @CRLF)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//POST Request&lt;/P&gt;
&lt;P&gt;$objHTTP.open($metod,$url &amp;amp; "?Xrfkey=" &amp;amp; $key, False,@UserName,$password)&lt;/P&gt;
&lt;P&gt;ConsoleWrite($url &amp;amp; "?Xrfkey=" &amp;amp; $key &amp;amp; @CRLF)&lt;/P&gt;
&lt;P&gt;$objHTTP.setRequestHeader("X-Qlik-Xrfkey",$key)&lt;/P&gt;
&lt;P&gt;$objHTTP.send()&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;$data = $objHTTP.responseText&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;ConsoleWrite("Sense API Output: " &amp;amp; $objHTTP.responseText &amp;amp; @CRLF)&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first GET request works fine. The POST, fails.&lt;/P&gt;&lt;P&gt;If i run the same URLs using POSTMAN (a Chrome-plugin REST client). Post works directly without any issues.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2016 12:59:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Running-POST-request-trough-the-proxy/m-p/1170515#M5750</guid>
      <dc:creator>gustavgager</dc:creator>
      <dc:date>2016-06-10T12:59:49Z</dc:date>
    </item>
  </channel>
</rss>

