On 1 March 2017 at 16:14, Shyam Yenna <
write...@gmail.com> wrote:
> I am implementing below task and it throwing me HTTP Error: 400 Bad Request
That's not a task, but the (failed) output of it.
Since you didn't post your actual task, I will guess that you're
downloading a ZIP file, but forgot to escape the spaces in the URL:
visser@cajones:~$ curl -I
HTTP/1.0 200 Connection established
HTTP/1.0 400 Bad request
Cache-Control: no-cache
Connection: close
Content-Type: text/html
Compare this to:
visser@cajones:~$ curl -I
"
https://backstage.forgerock.com/downloads/OpenDJ/OpenDJ%20Enterprise/3.0.0/OpenDJ%203%20Zip/OpenDJ-3.0.0.zip"
HTTP/1.0 200 Connection established
HTTP/1.1 200 OK
Date: Thu, 02 Mar 2017 08:41:06 GMT
Server: Apache/2.4.6 (Red Hat) OpenSSL/1.0.0-fips OpenAM WPA/3.3.4
X-Frame-Options: SAMEORIGIN
Last-Modified: Fri, 17 Feb 2017 10:40:55 GMT
Accept-Ranges: bytes
Content-Length: 2128
Vary: Accept-Encoding
Cache-Control: max-age=0,no-cache
nid: prod2
Content-Type: text/html; charset=UTF-8
Set-Cookie: fr_backstage_lb_prod=prod2; path=/
However, this isn't a file but instead a web page asking to sign in.
With valid credentials that might work, but it could also be that the
server want something more fancy than basic auth.
It's up to you to find that out.
If that happens, you'd probably have to store a cookie first.
Note that your URL initially gets redirected to HTTPS - you might want
to use that to start with.
Dick
--
Dick Visser
Sr. System & Network Engineer
GÉANT
Want to join us? We're hiring:
https://www.geant.org/jobs