如何使用Dart刮擦带有登录页面的网站?

时间:2019-01-10 18:28:03

标签: dart

我想登录一个网站,但是我不能,而且我还是Dart的新手。 我尝试运行此代码:

var url = "https://example.com/login";
  http.post(url, body: {"login": "xxxxx", "password": "xxxx"})
      .then((response) {
    print("Response status: ${response.statusCode}");
    print("Response body: ${response.body}");

此后,我收到发帖请求:

Response status: 302
Response body: //empty

1 个答案:

答案 0 :(得分:0)

A 302表示重定向– https://en.wikipedia.org/wiki/HTTP_302

查看响应中的location标头,然后执行另一个请求!

相关问题