Flutter - Как получить данные с сайта, который имеет защиту Cloudflare DDOS - PullRequest
1 голос
/ 04 мая 2020

Я пытаюсь получить данные с моего сайта. Но когда я печатаю response.body, я получаю тело дизайна защиты CloudOS Flare DDOS. Вот мой код:

  var url = 'https://example.com/mycontroller/myfunction/' + myParameter;
  http.Response response = await http.get(url);
  print(url.toString());
  print(response.body.toString());

Вот его вывод:


I/flutter ( 5748): <!DOCTYPE HTML>
I/flutter ( 5748): <html lang="en-US">
I/flutter ( 5748): <head>
I/flutter ( 5748):   <meta charset="UTF-8" />
I/flutter ( 5748):   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
I/flutter ( 5748):   <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
I/flutter ( 5748):   <meta name="robots" content="noindex, nofollow" />
I/flutter ( 5748):   <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
I/flutter ( 5748):   <meta http-equiv="refresh" content="12">
I/flutter ( 5748):   <title>Just a moment...</title>
I/flutter ( 5748):   <style type="text/css">
I/flutter ( 5748):     html, body {width: 100%; height: 100%; margin: 0; padding: 0;}
I/flutter ( 5748):     body {background-color: #ffffff; color: #000000; font-family:-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, "Helvetica Neue",Arial, sans-serif; font-size: 16px; line-height: 1.7em;-webkit-font-smoothing: antialiased;}
I/flutter ( 5748):     h1 { text-align: center; font-weight:700; margin: 16px 0; font-size: 32px; color:#000000; line-height: 1.25;}
I/flutter ( 5748):     p {font-size: 20px; font-weight: 400; margin: 8px 0;}
I/flutter ( 5748):     p, .attribution, {text-align: center;}
I/flutter ( 5748):     #spinner {margin: 0 auto 

Я пытаюсь проверить код состояния и получаю код состояния 503. Как я могу пройти защиту DDOS и получить мои данные?

...