cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Curl sends me to main web page when it exists redirect.

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 23 Oct 2016 23:34:34 +0200 (CEST)

On Sun, 23 Oct 2016, mierdatutis mi wrote:

> I'm downloading every some time a url of website. Everything is ok but
> sometimes it gives me an 302 error and the website redirect me to main web
> page. There is some way to can go to the url that I like or that the
> redirect finish in the webpage that I'm searching.

The server decides what to respond with and curl just acts on what the server
says. If the server responds with a 302, then there's no alternative action
for curl to do.

You can ask curl to follow that direct by using -L, --location.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-users
FAQ:        https://curl.haxx.se/docs/faq.html
Etiquette:  https://curl.haxx.se/mail/etiquette.html
Received on 2016-10-23