Hello world,
so since start of the year I struggle with loading data from twitter inside HANA with HANA XSJS dev methods. So since SP07 there are timed batch jobs with xsjs development it should be really easy to load some data inside HANA.
So far so good...
To start I choose twitter api, which like most api's require oauth. So I was able to build my own oauth token and testet a twitter api request with this oauth token from my local machine. It worked and this is not the problem. The request was really simple, a http GET with one header field "Authorization" : "my oAuth token"
But when I do this on HANA twitter gives be a code 32 bad request message.
I alredy do request other apis like weather or financial data, so http communication is working.
I tried to find my request in the web dispatcher log to take a look at how my http request to twitter exactly looks like. Increasing log level to max, but I do not see the outgoing request!!!
anybody has any idea where to find my http request, here's my call, already debuged it:
var dest = $.net.http.readDestination("mypackagepath", "twitter"); var client = new $.net.http.Client(); //var req = new $.web.WebRequest($.net.http.GET, "?q=" + query); var req = new $.net.http.Request($.net.http.GET, "/1.1/search/tweets.json?q=mytags" ); var oauth_header = get_oauth_header(query); //req.parameters.set("Authorization",oauth_header ); req.headers.set("Content-Type", "application/x-www-form-urlencoded"); req.headers.set("host", "api.twitter.com"); req.headers.set("Authorization", oauth_header); //client.request(req, "http://api.twitter.com","myproxy:myport" ); //$.trace.debug(oauth_header); client.request(req, dest); var response = client.getResponse();