Quantcast
Channel: SCN : Discussion List - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 5653

SAP Hana XS app and outbound connection to http Webpage

$
0
0

Hello folks,

 

i just got into the development with SAP Hana XS trial instance and wanted to create my first app which should analyze a webpage and store the results in the SAP Hana database.

 

What i currently achieve is the outbound http connection just like in the examples given from SAP (with Google Maps API).

 

Now i wanted to download a webpage through SAP Hana XS and analyze its contents. Unfortunately i only receive the following error when trying to display just the contents of the fetched url:

 

"Error: Body.asString : unsupported charset specified in Content-Type header (""UTF-8"") "

 

Could you guys please give me hint what i should do to   :

     a) see if the XS app has actually downloaded the right page

     b) to receive the webpage internally as a string

 

Besides that i wanted to ask you if it is possible to Debug in the Web-IDE ? Do i have a console where i can log some variables?

 

I attached my XS app so that you can have a look at the code.

 

try {

       var dest = $.net.http.readDestination(destination_package, destination_name);

       var client = new $.net.http.Client();

       var req = new $.web.WebRequest($.net.http.GET, "/LS9DVX");

       client.request(req, dest);

       var response = client.getResponse(); 

      

    if(response.body){body = response.body.asString(); }

       $.response.status = $.net.http.OK;

} catch (e) {

       $.response.setBody(response.body.asString());

}


Viewing all articles
Browse latest Browse all 5653

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>