cURL: как сделать скрипт входа (по протоколу https)? - PullRequest
0 голосов
/ 01 апреля 2012

Вот простая страница входа, которая работает как панель входа для 4shared.com:

.
<form id="login_form" method="post" action="https://www.4shared.com/index.jsp">   
    <input type="text" placeholder="username" name="login" id="iloginfield">
    <input type="password" placeholder="password here" name="password" id="ipassfield">
    <input type="submit"  value="Login">
</form>

Это работает. И я думал, что смогу просто бежать:

curl  "http://www.4shared.com/index.jsp" -d "login=xxxxxxx&password=yyyyyyyyyyyyy" -D "/tmp/header.txt"

Что должно было сработать. Но это не удалось.

Почему? Как я могу это сделать?

1 Ответ

0 голосов
/ 01 апреля 2012

Какой выход вы видите? Возможно, вы захотите сохранить куки-файлы, отправленные вам сервером.

   -c/--cookie-jar <file name>
          Specify to which file you want curl to write all cookies after a
          completed  operation.  Curl  writes  all cookies previously read
          from a specified file as  well  as  all  cookies  received  from
          remote server(s). If no cookies are known, no file will be writ‐
          ten. The file will be written using  the  Netscape  cookie  file
          format.  If  you  set  the  file name to a single dash, "-", the
          cookies will be written to stdout.

          NOTE If the cookie jar can't be created or written to, the whole
          curl operation won't fail or even report an error clearly. Using
          -v will get a warning displayed, but that is  the  only  visible
          feedback you get about this possibly lethal situation.

          If  this  option  is used several times, the last specified file
          name will be used.
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...