I am working on a java project in which I need to generate url to get data i.e open,low,high,close etc prices from yahoo
Similar post here suggests to use URLEncoder.encode(query, "UTF-8") from java.net.URLEncoder but this generates url in a differnt format.
Example: For this query
select * from yahoo.finance.historicaldata where symbol in ("YHOO","AAPL") and startDate = "2014-01-01" and endDate = "2014-02-01"
It gives url:
http://query.yahooapis.com/v1/public/yql?q=select+*+from+yahoo.finance.historicaldata+where+symbol+in+%28%22YHOO%22%2C%22AAPL%22%29+and+startDate+%3D+%222014-01-01%22+and+endDate+%3D+%222014-02-01%22&format=json
whereas I need url in this format
https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.historicaldata%20where%20symbol%20in%20(%22YHOO%22%2C%22AAPL%22)%20and%20startDate%20%3D%20%222014-01-01%22%20and%20endDate%20%3D%20%222014-02-01%22&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=
Please suggest how I convert this query to above mentioned url.
Thanks,