]> gitweb.factorcode.org Git - factor.git/commitdiff
http.client.post-data: make >post-data public
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 30 Oct 2023 01:37:12 +0000 (20:37 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 30 Oct 2023 01:41:02 +0000 (20:41 -0500)
basis/http/client/post-data/post-data.factor

index ed851698d080c1bb319c162690f4ca0d76753485..26c3033b83935db9c892146c0cd4c646065c2cf0 100644 (file)
@@ -45,25 +45,6 @@ M: object (write-post-data)
     [ [ write-chunk ] each-block ] with-input-stream
     "0;\r\n" ascii encode write ;
 
-GENERIC: >post-data ( object -- post-data )
-
-M: f >post-data ;
-
-M: post-data >post-data ;
-
-M: string >post-data
-    utf8 encode
-    "application/octet-stream" <post-data>
-        swap >>data ;
-
-M: assoc >post-data
-    "application/x-www-form-urlencoded" <post-data>
-        swap >>params ;
-
-M: object >post-data
-    "application/octet-stream" <post-data>
-        swap >>data ;
-
 : pathname>measured-stream ( pathname -- stream )
     string>>
     [ binary <file-reader> &dispose ]
@@ -83,6 +64,26 @@ M: object >post-data
 
 PRIVATE>
 
+
+GENERIC: >post-data ( object -- post-data )
+
+M: f >post-data ;
+
+M: post-data >post-data ;
+
+M: string >post-data
+    utf8 encode
+    "application/octet-stream" <post-data>
+        swap >>data ;
+
+M: assoc >post-data
+    "application/x-www-form-urlencoded" <post-data>
+        swap >>params ;
+
+M: object >post-data
+    "application/octet-stream" <post-data>
+        swap >>data ;
+
 : unparse-post-data ( request -- request )
     [ >post-data ] change-post-data
     normalize-post-data ;