[vlc-devel] Adding POST support to the http access module
fawek at fawek.net
Wed Dec 29 16:49:40 CET 2010
2010/12/29 Rémi Denis-Courmont <remi at remlab.net>:
> On Tuesday 28 December 2010, Jakub Wieczorek wrote:
>> The problem I'm struggling with is that the HTTP module
>> doesn't support the POST operation, which is the mandatory method for
>> one of the requests I need to be making to the service. I would like
>> to add support for this to that module but I'm not sure if such
>> addition would be acceptable given that, from what I understand, the
>> access modules were designed to support "read-only" routines for
>> playback and not to support the entire protocols.
> The HTTP access assumes that HTTP requests are idempotent. And the whole point
> of POST requests is to be non-idempotent, whereas GET requests are idempotent.
> So HTTP POST really does _not_ belong there.
I suspected so. I guess the solution for my module will be to either
switch to a 3rd party HTTP implementation or simply speak HTTP inline
via a socket.
> On top of that, form data cannot be represented in HTTP request URIs, at least
> not in a standard fashion.
Yes. Actually I solved this by using a http-message-body option. I
know this kind of sucks, especially for huge data which would be
better written incrementally, but that's the best I've come up with
without changing the stream interface. You can see the code here:
FWIW, my module isn't the only one in need for this.
misc/audioscrobbler also uses POST and in the lack of support for
this, it just reimplements the necessary parts of the protocol. I
don't think reinventing the wheel every now and then is a good idea so
ideally there'd be a second way to use HTTP that meets the
requirements of online services rather than just playback.
More information about the vlc-devel