It should, so long as you set your HTTPService's method property to POST. If you omit it, it will default to GET, and the parameters will be sent as part of the query string, not as POST data.
I set up this scenario using this Flex code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application layout="absolute"
xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="init()">
<mx:HTTPService id="service"
url="http://localhost:8000/"
method="POST"
resultFormat="text"
result="response.htmlText=ResultEvent(event).result.toString()"/>
<mx:Text id="response" width="100%" height="100%"/>
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
private function init() : void {
service.send({
foo: "Fred",
bar: "Barney"
});
}
]]>
</mx:Script>
</mx:Application>
And this python server code:
#!/usr/bin/env python
import SimpleHTTPServer, BaseHTTPServer, string
class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_POST(self):
self.send_response(200)
self.send_header("Content-type", "text/html")
self.end_headers()
self.wfile.write("<html><body>")
self.wfile.write("<b>METHOD:</b> " + self.command)
# Write out Headers
header_keys = self.headers.dict.keys()
for key in header_keys:
self.wfile.write("<br><b>" + key + "</b>: ")
self.wfile.write(self.headers.dict[key])
# Write out any POST data
if self.headers.dict.has_key("content-length"):
content_length = string.atoi(self.headers.dict["content-length"])
raw_post_data = self.rfile.read(content_length)
self.wfile.write("<br><b>Post Data:</b> " + raw_post_data)
self.wfile.write("</body></html>")
def do_GET(self):
self.do_POST()
try:
BaseHTTPServer.test(MyHandler, BaseHTTPServer.HTTPServer)
except KeyboardInterrupt:
print 'Exiting...'
And got this result:
METHOD: POST
content-length: 19
accept-language: en-us,en;q=0.5
accept-encoding: gzip,deflate
connection: keep-alive
keep-alive: 300
accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
user-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1
accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
host: 10.0.7.61:8000
content-type: application/x-www-form-urlencoded
Post Data: bar=Barney&foo=Fred
So it should work.