Files
prosperon/tests/http.ce

25 lines
768 B
Plaintext

var http = use('http')
var text = use('text')
// Test with a simpler endpoint first
log.console("Testing httpbin.org chunked response...")
try {
var b = http.fetch("https://httpbin.org/stream/3")
log.console(b.length)
var text1 = text(b)
log.console("httpbin response length:", text1.length)
log.console("httpbin response:", text1)
} catch (e) {
log.console("httpbin error:", e)
}
log.console("\nTesting dictionary.ink...")
try {
var b2 = http.fetch("https://dictionary.ink/find?word=theological")
log.console(b2.length)
var text2 = text(b2)
log.console("dictionary response length:", text2.length)
log.console("dictionary first 500 chars:", text2.substring(0, 500))
} catch (e) {
log.console("dictionary error:", e)
}