[svn:parrot] r46744 - in trunk: . examples/io

fperrad at svn.parrot.org fperrad at svn.parrot.org
Mon May 17 18:27:32 UTC 2010


Author: fperrad
Date: Mon May 17 18:27:31 2010
New Revision: 46744
URL: https://trac.parrot.org/parrot/changeset/46744

Log:
[LWP] add an example: post.pir (don't work)

Added:
   trunk/examples/io/post.pir   (contents, props changed)
Modified:
   trunk/MANIFEST

Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST	Mon May 17 16:32:31 2010	(r46743)
+++ trunk/MANIFEST	Mon May 17 18:27:31 2010	(r46744)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Mon May 17 15:32:39 2010 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Mon May 17 18:24:33 2010 UT
 #
 # See below for documentation on the format of this file.
 #
@@ -582,6 +582,7 @@
 examples/io/get.pir                                         [examples]
 examples/io/http.pir                                        [examples]
 examples/io/httpd.pir                                       [examples]
+examples/io/post.pir                                        [examples]
 examples/japh/README                                        [examples]
 examples/japh/japh1.pasm                                    [examples]
 examples/japh/japh3.pasm                                    [examples]

Added: trunk/examples/io/post.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/examples/io/post.pir	Mon May 17 18:27:31 2010	(r46744)
@@ -0,0 +1,49 @@
+#!parrot
+# Copyright (C) 2010, Parrot Foundation.
+
+.include 'iglobals.pasm'
+
+.sub 'send_archive_to_smolder' :main
+    .local pmc config
+    $P0 = getinterp
+    config = $P0[.IGLOBALS_CONFIG_HASH]
+    .local pmc contents
+    contents = new 'ResizablePMCArray' # by couple
+    push contents, 'architecture'
+    $S0 = config['cpuarch']
+    push contents, $S0
+    push contents, 'platform'
+    $S0 = config['osname']
+    push contents, $S0
+    push contents, 'revision'
+    $S0 = config['revision']
+    push contents, $S0
+    push contents, 'username'
+    push contents, 'parrot-autobot'
+    push contents, 'password'
+    push contents, 'squ at wk'
+    push contents, 'comments'
+    push contents, "EXPERIMENTAL LWP.pir"
+    push contents, 'report_file'
+    $P0 = new 'FixedStringArray'
+    set $P0, 6
+    $P0[0] = 'parrot_test_run.tar.gz' # filename
+    $P0[1] = 'parrot_test_run.tar.gz' # usename
+    $P0[2] = 'Content-Type'
+    $P0[3] = 'application/x-tar'
+    $P0[4] = 'Content-Encoding'
+    $P0[5] = 'gzip'
+    push contents, $P0
+    load_bytecode 'LWP.pir'
+    .const string url = 'http://smolder.plusthree.com/app/projects/process_add_report/8'
+    .local pmc ua, response
+    ua = new ['LWP';'UserAgent']
+    ua.'show_progress'(1)
+    response = ua.'post'(url, contents :flat, 'form-data' :named('Content-Type'), 'TE, close' :named('Connection'), 'deflate,gzip;q=0.3' :named('TE'))
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:


More information about the parrot-commits mailing list