getv6.es.tst 684 B

123456789101112131415161718192021222324
  1. /*
  2. getv6.tst - IPv6 GET tests
  3. */
  4. const HTTPV6 = tget('TM_HTTPV6') || "[::1]:8090"
  5. let http: Http = new Http
  6. // Basic get. Validate response code and contents
  7. http.get(HTTPV6 + "/index.html")
  8. ttrue(http.status == 200)
  9. // ttrue(http.readString().contains("Hello"))
  10. // Validate get contents
  11. http.get(HTTPV6 + "/index.html")
  12. ttrue(http.readString(12) == "<html><head>")
  13. // Validate get contents
  14. http.get(HTTPV6 + "/index.html")
  15. ttrue(http.response.endsWith("</html>\n"))
  16. ttrue(http.response.endsWith("</html>\n"))
  17. // Test Get with a body. Yes this is valid Http, although unusual.
  18. http.get(HTTPV6 + "/index.html", 'name=John&address=700+Park+Ave')
  19. ttrue(http.status == 200)