1.1 --- a/MoinMessage.py Sat Jun 22 02:08:15 2013 +0200
1.2 +++ b/MoinMessage.py Tue Jun 25 18:28:44 2013 +0200
1.3 @@ -416,9 +416,12 @@
1.4 else:
1.5 message["Date"] = datestr
1.6
1.7 -def sendMessage(message, url):
1.8 +def sendMessage(message, url, method="PUT"):
1.9
1.10 - "Send 'message' to the given 'url."
1.11 + """
1.12 + Send 'message' to the given 'url' using the given 'method' (using PUT as the
1.13 + default if omitted).
1.14 + """
1.15
1.16 scheme, host, port, path = parseURL(url)
1.17 text = message.as_string()
1.18 @@ -431,7 +434,7 @@
1.19 raise MoinMessageError, "Communications protocol not supported: %s" % scheme
1.20
1.21 req = cls(host, port)
1.22 - req.request("PUT", path, text)
1.23 + req.request(method, path, text)
1.24 resp = req.getresponse()
1.25
1.26 if resp.status >= 400:
2.1 --- a/README.txt Sat Jun 22 02:08:15 2013 +0200
2.2 +++ b/README.txt Tue Jun 25 18:28:44 2013 +0200
2.3 @@ -273,5 +273,15 @@
2.4 the content is stored in a message store associated with the Wiki page.
2.5
2.6 Each update may describe multiple representations of some content by employing
2.7 -a multipart section containing parts for each of the representations.
2.8 -Alternatively, a single message part may describe a single representation.
2.9 +a multipart/alternative section containing parts for each of the
2.10 +representations. Alternatively, a single message part may describe a single
2.11 +representation.
2.12 +
2.13 +HTTP Methods
2.14 +------------
2.15 +
2.16 +Since MoinMoin seems to reserve POST methods for request/entity bodies that
2.17 +contain HTML form data, it is necessary to use alternative methods to post
2.18 +messages to a site served by MoinMoin and to fetch messages from such a site.
2.19 +Consequently, MoinMessage uses PUT to post messages and recommends GET to
2.20 +fetch messages.
3.1 --- a/tests/test_fetch.py Sat Jun 22 02:08:15 2013 +0200
3.2 +++ b/tests/test_fetch.py Tue Jun 25 18:28:44 2013 +0200
3.3 @@ -29,7 +29,7 @@
3.4 try:
3.5 signed_message = gpg.signMessage(email_message, signer)
3.6 encrypted_message = gpg.encryptMessage(signed_message, recipient)
3.7 - print sendMessage(encrypted_message, url)
3.8 + print sendMessage(encrypted_message, url, "GET")
3.9 except MoinMessageError, exc:
3.10 print exc
3.11