xbmc/xbmc — pull request #1572 by Red-F (2012-10-08 20:36:01+00:00)
Title: Provide IFile consumers a rudimentary HTTP POST option

Currently binary addons can not access and use the full functionality provided by CCurlFile to access a webservice.

eg. PVR addons can use a simple GET via the IFile interface by using the sequence:

- Open
- ReadString or Read (until data is exhausted)
- Close

This change extends that with a very rudimentary support for POST with post data via the IFile interface by using the sequence:

- Open
- Write (postdata)
- ReadString or Read (until data is exhausted)
- Close

What's not pretty? Content-Type is hard coded to application/json at this time. In a future version this might be configurable by allowing headers to be added via IoControl (IOCTRL_NATIVE).

fix: allow post with postdata length of zero bytes
fix: SetMimeType didn't work
added: implementation of IFile's OpenForWrite and Write methods