http - XMLHttpRequest with Pentaho Data Integration to get the response header -


i'm working pentaho data integration , need step gives me response header of http request. need implementatione of head method of http call because have see last-modified field of resorce on internet. tried using rest client step doesn't work. write script makes need. created modified java script value , put code inside:

var req = new xmlhttprequest(); req.open('get', 'url', false); req.send(null); var headers = req.getallresponseheaders().tolowercase(); 

when run it doesn't gives me error there's in "headers".

any suggestions? appreciate different solution to

if url you're requesting on different domain can tell server not sending correct headers allow cross-domain resource sharing.

access-control-allow-origin: * 

without server sending header way access of response (including headers) if script running on same domain (and protocol) or if setup proxy on own server data remote server.

if open js console on page , run:

var req = new xmlhttprequest(); req.open('get', 'http://dati.toscana.it/it/storage/f/2012-07-26t160139/intoscana-arte-e-cultura.csv', false); req.send(null); console.log(req.getallresponseheaders()); 

i following output:

xmlhttprequest cannot load http://dati.toscana.it/it/storage/f/2012-07-26t160139/intoscana-arte-e-cultura.csv. origin http://stackoverflow.com not allowed access-control-allow-origin. networkerror: network error occurred. 

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -