<?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>Question Re: CL_HTTP_CLIENT returns javascript code in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/cl-http-client-returns-javascript-code/qaa-p/600457#M141682</link>
    <description>&lt;P&gt;Hello Sap Manie,&lt;/P&gt;
  &lt;P&gt;first of all, you are receiving an HTML page, not Javascript: you can see it from the initial tag &lt;STRONG&gt;&amp;lt;HTML&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;This means that you are receiving the web page source as answer: the same thing you can see if (on CHROME) you press F12&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/159644-source.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Check the webservice you are calling (the URL) if it accepts/need a parameter to specify the output (JSON, HTML, XML...) &lt;/P&gt;</description>
    <pubDate>Fri, 15 Jun 2018 09:42:29 GMT</pubDate>
    <dc:creator>SimoneMilesi</dc:creator>
    <dc:date>2018-06-15T09:42:29Z</dc:date>
    <item>
      <title>CL_HTTP_CLIENT returns javascript code</title>
      <link>https://community.sap.com/t5/technology-q-a/cl-http-client-returns-javascript-code/qaq-p/600454</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;My ABAP program is using CL_HTTP_CLIENT to read currency rates off a banks HTTP webpage. It's a simple read on a public facing website that returns data in XML format, no logging in or anything is required. Sometimes the data is read correctly but seemingly randomly, this javascript code below is returned instead:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt; &amp;lt;HTML&amp;gt;&amp;lt;HEAD&amp;gt;&amp;lt;META HTTP-EQUIV="Refresh" CONTENT="0"&amp;gt;&amp;lt;SCRIPT Language="JavaScript"&amp;gt;var coupon1= 23432;var coupon2= 23432;var style1= 21154;var style2= 123432;var add =coupon1+coupon2+style1+style2;document.cookie="MTD_EPTQ="+add+";path=/";window.location=window.location.href;window.focus();&amp;lt;/SCRIPT&amp;gt;&amp;lt;/HEAD&amp;gt;&amp;lt;/HTML&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;What is also strange is I have the same program scheduled to run at the same time on another system, and that would read the webpage OK. The currencies are updated hours before the ABAP program is run so I know they aren't being updated by the bank at that time. My expertise is ABAP not this web stuff so I am confused as to what could be happening. Any help would be appreciated, thanks!&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Thks,&lt;BR /&gt;sapmanie&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 21:55:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cl-http-client-returns-javascript-code/qaq-p/600454</guid>
      <dc:creator>former_member191998</dc:creator>
      <dc:date>2018-06-12T21:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: CL_HTTP_CLIENT returns javascript code</title>
      <link>https://community.sap.com/t5/technology-q-a/cl-http-client-returns-javascript-code/qaa-p/600455#M141680</link>
      <description>&lt;P&gt;If you know of a pattern by which this random output can be reliably reproduced, then debugging till external call is made and response is retrieved is one possible hint.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2018 18:03:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cl-http-client-returns-javascript-code/qaa-p/600455#M141680</guid>
      <dc:creator>Ankit_Maskara</dc:creator>
      <dc:date>2018-06-14T18:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: CL_HTTP_CLIENT returns javascript code</title>
      <link>https://community.sap.com/t5/technology-q-a/cl-http-client-returns-javascript-code/qaa-p/600456#M141681</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Is it possible to add the URL here? &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Maybe this website has a JS protection system or it is created with a JS framework.&lt;/P&gt;
  &lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2018 18:16:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cl-http-client-returns-javascript-code/qaa-p/600456#M141681</guid>
      <dc:creator>enric101</dc:creator>
      <dc:date>2018-06-14T18:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: CL_HTTP_CLIENT returns javascript code</title>
      <link>https://community.sap.com/t5/technology-q-a/cl-http-client-returns-javascript-code/qaa-p/600457#M141682</link>
      <description>&lt;P&gt;Hello Sap Manie,&lt;/P&gt;
  &lt;P&gt;first of all, you are receiving an HTML page, not Javascript: you can see it from the initial tag &lt;STRONG&gt;&amp;lt;HTML&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;This means that you are receiving the web page source as answer: the same thing you can see if (on CHROME) you press F12&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/159644-source.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Check the webservice you are calling (the URL) if it accepts/need a parameter to specify the output (JSON, HTML, XML...) &lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 09:42:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cl-http-client-returns-javascript-code/qaa-p/600457#M141682</guid>
      <dc:creator>SimoneMilesi</dc:creator>
      <dc:date>2018-06-15T09:42:29Z</dc:date>
    </item>
  </channel>
</rss>

