How can this example of expath be adapted to grab and store a CSV file directly from a website?
xquery version "3.1";
import module namespace hc = "http://expath.org/ns/http-client";
let $url := "https://www.kingjamesbibleonline.org/Genesis-Chapter-1_Original-1611-KJV/"
let $request :=
<hc:request href="{$url}" method="GET">
<hc:header name="Connection" value="close"/>
</hc:request>
return
hc:send-request($request)
Browsing to:
http://www.bccdc.ca/health-info/diseases-conditions/covid-19/data
the specific CSV file is:
http://www.bccdc.ca/Health-Info-Site/Documents/BCCDC_COVID19_Dashboard_Case_Details.csv
Of course, there are a multitude of ways to grab that file. But, how would it be done with xquery as above?
Obviously, changing the URL is the starting point, which, indeed, results in a large CSV file printed to the console.