I’m using Windows 10 and curl 7.55.1 (Windows) libcurl/7.55.1 WinSSL.
I’m trying to download files from the ESA API using this curl
command:
curl --ssl-no-revoke -u eduardojsilvajr \
https://scihub.copernicus.eu/dhus/search?q=footprint:"Intersects(POLYGON((-4.53 29.85,26.75 29.85,26.75 46.80,-4.53 46.80,-4.53 29.85)))"
This is an example from the Copernicus Open Access Hub API site.
But when I run the above curl
command, I get this message:
<?xml version="1.0" encoding="utf-8"?><feed xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns="http://www.w3.org/2005/Atom">
<title>Sentinels Scientific Data Hub search results for: footprint:Intersects(POLYGON((-4.53</title>
<subtitle>Displaying results. Request done in 0.001 seconds.</subtitle>
<updated>2019-02-20T23:17:34.037Z</updated>
<author>
<name>Sentinels Scientific Data Hub</name>
</author>
<id>https://scihub.copernicus.eu/dhus/search?q=footprint:Intersects(POLYGON((-4.53</id>
<opensearch:totalResults/>
<opensearch:startIndex>0</opensearch:startIndex>
<opensearch:itemsPerPage>10</opensearch:itemsPerPage>
<opensearch:Query role="request" searchTerms="footprint:Intersects(POLYGON((-4.53" startPage="1"/>
<link rel="self" type="application/atom+xml" href="https://scihub.copernicus.eu/dhus/search?q=footprint:Intersects(POLYGON((-4.53&start=0&rows=10"/>
<link rel="first" type="application/atom+xml" href="https://scihub.copernicus.eu/dhus/search?q=footprint:Intersects(POLYGON((-4.53&start=0&rows=10"/>
As you can see there is a problem with spaces. I tried backslash, single quotes, double quotes, and passing the URL using a file (@file), but nothing makes this curl
command work.
How do I make it work?
"https://scihub.copernicus.eu/dhus/search?q=footprint:Intersects(POLYGON((-4.53 29.85,26.75 29.85,26.75 46.80,-4.53 46.80,-4.53 29.85)))"
"Intersects(POLYGON((-4.53\ 29.85,26.75\ 29.85,…
. Try this with"
and again with'
. (2) The ugly answer: try replacing the spaces with%20
; e.g.,"Intersects(POLYGON((-4.53%2029.85,26.75%2029.85.…
. Try this with and without quotes (but it’s probably best to use quotes).