How can I find where I will be redirected using cURL?

前端 未结 7 1927
小鲜肉
小鲜肉 2020-11-22 03:53

I\'m trying to make curl follow a redirect but I can\'t quite get it to work right. I have a string that I want to send as a GET param to a server and get the resulting URL.

7条回答
  •  耶瑟儿~
    2020-11-22 04:46

    Sometimes you need to get HTTP headers but at the same time you don't want return those headers.**

    This skeleton takes care of cookies and HTTP redirects using recursion. The main idea here is to avoid return HTTP headers to the client code.

    You can build a very strong curl class over it. Add POST functionality, etc.

提交回复
热议问题