Skip to content

Instantly share code, notes, and snippets.

@rootsec1
Last active June 28, 2019 08:12
Show Gist options
  • Save rootsec1/22b271265e44509dde743eb14dcb39e5 to your computer and use it in GitHub Desktop.
Save rootsec1/22b271265e44509dde743eb14dcb39e5 to your computer and use it in GitHub Desktop.

Revisions

  1. Abhishek W.L revised this gist Jun 28, 2019. No changes.
  2. Abhishek W.L revised this gist Jun 28, 2019. No changes.
  3. Abhishek W.L revised this gist Jun 28, 2019. No changes.
  4. Abhishek W.L revised this gist Jun 28, 2019. No changes.
  5. rootsec1 created this gist Jun 10, 2019.
    16 changes: 16 additions & 0 deletions httprequest.dart
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    import 'dart:io';
    import 'dart:convert';

    class HttpRequestClass {
    void fetchAndDisplay() {
    HttpClient()
    .getUrl(Uri.parse('https://us-central1-hunt-primary.cloudfunctions.net/pruoo?n=5'))
    .then((request) => request.close())
    .then((response) => response.transform(Utf8Decoder()).listen(print));
    }
    }

    void main() {
    HttpRequestClass httpRequestClass = new HttpRequestClass();
    httpRequestClass.fetchAndDisplay();
    }