What’s the Best curl Option to Handle Redirects? or How Do You Use the --data curl Option for POST Re

18 Replies, 857 Views

`-L` should handle most redirects, but if it’s not, you might need to tweak the max redirects with `--max-redirs`. Default is 50, which is usually enough, but some servers are... special.

Also, if you’re dealing with auth, `-L` can drop headers, so watch out for that. `--location-trusted` might help if you’re sending sensitive stuff.

For tools, Postman’s CLI (`newman`) can handle redirects too, if curl’s being stubborn.

Messages In This Thread



Users browsing this thread: 1 Guest(s)