USING: accessors http http.client http.client.private
-io.streams.string kernel namespaces sequences tools.test urls ;
+io.streams.string kernel namespaces sequences splitting
+tools.test urls ;
IN: http.client.tests
{ "foo.txt" } [ "http://www.paulgraham.com/foo.txt" download-name ] unit-test
{ method "GET" }
{ version "1.1" }
{ cookies V{ } }
- { header H{ { "connection" "close" } { "user-agent" "Factor http.client" } } }
+ { header H{ { "Connection" "close" } { "User-Agent" "Factor http.client" } } }
{ redirects 10 }
}
} [
{ method "GET" }
{ version "1.1" }
{ cookies V{ } }
- { header H{ { "connection" "close" } { "user-agent" "Factor http.client" } } }
+ { header H{ { "Connection" "close" } { "User-Agent" "Factor http.client" } } }
{ redirects 10 }
}
} [
! hit the velox.ch website.
! { t } [
! "https://alice.sni.velox.ch" http-get nip
- ! [ "Great!" swap subseq? ]
- ! [ "TLS SNI Test Site: alice.sni.velox.ch" swap subseq? ] bi and
+ ! [ "Great!" subseq-of? ]
+ ! [ "TLS SNI Test Site: alice.sni.velox.ch" subseq-of? ] bi and
! ] unit-test
{ t } [
"content-type: text/html; charset=UTF-8"
"date: Wed, 12 Oct 2011 18:57:49 GMT"
"server: Factor http.server"
- } [ "\n" join ] [ "\r\n" join ] bi
+ } [ join-lines ] [ "\r\n" join ] bi
[ [ read-response ] with-string-reader ] same?
] unit-test