post.es.tst 390 B

12345678910111213141516
  1. /*
  2. post.tst - Post method tests
  3. */
  4. const HTTP = tget('TM_HTTP') || "127.0.0.1:8080"
  5. let http: Http = new Http
  6. http.post(HTTP + "/action/test", "Some data")
  7. ttrue(http.status == 200)
  8. http.close()
  9. http.form(HTTP + "/action/test", {name: "John", address: "700 Park Ave"})
  10. ttrue(http.response.contains('name: John'))
  11. ttrue(http.response.contains('address: 700 Park Ave'))
  12. http.close()