casimirian: (Default)
casimirian ([personal profile] casimirian) wrote in [site community profile] dw_dev2018-01-01 06:19 pm
Entry tags:

XMLRPG?

Was there a reason GET is disabled for https://www.dreamwidth.org/interface/xmlrpc?
mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)

[staff profile] mark 2018-01-02 12:25 am (UTC)(link)
To answer the specific question, I don't remember.

I don't think the API does anything with GET requests thought? I feel like POST is the only thing we'd want to support?
mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)

[staff profile] mark 2018-01-02 12:59 am (UTC)(link)
GET can only be used for idempotent things that don't change any state, and I don't believe there is anything in our API that is really idempotent + doesn't change state?

Anyway, moot point since it sounds like you're also having problems with third party clients trying to do POST requests. I did some investigation and it looks like the problem is that the `python-lj` library is using insecure HTTP which is explicitly no longer supported. Someone will have to fix that.

So, I don't believe that not supporting GET has anything to do with the problem here, it's just a broken client not accessing the secured HTTPS endpoint correctly.
lithiumdoll: (Default)

[personal profile] lithiumdoll 2018-07-15 11:52 am (UTC)(link)
Kind of a "from the mists of time" thing, but just in case anyone else using the lj lib at https://github.com/daniilr/python-lj finds this:

For DW, just subclass LJServer and create DWTransport to use xmlrpclib.SafeTransport instead of xmlrpclib.Transport. (Or don't bother and just straight use xmlrpclib.SafeTransport, sure, whatever:P)

try:
    import xmlrpc.client as xmlrpclib
except ImportError:
    import xmlrpclib
try:
    import urllib.request as urllib2
except ImportError:
    import urllib2


from lj import lj


class DWTransport(xmlrpclib.SafeTransport):
    pass


class DWServer(lj.LJServer):
    def __init__(self, clientversion, user_agent, host='https://www.dreamwidth.org/'):
        super().__init__(clientversion, user_agent, host)
        transport = DWTransport()
        transport.user_agent = user_agent
        self.server = xmlrpclib.ServerProxy(host + 'interface/xmlrpc', transport)

dreamwidth = DWServer("Python-Blog3/1.0", "http://yoursite.com; your@email.com")
dreamwidth.login(username, password)
response = dreamwidth.postevent(subject, message)
Edited 2018-07-15 11:55 (UTC)
lithiumdoll: (Default)

[personal profile] lithiumdoll 2018-07-16 06:55 am (UTC)(link)
Oh cool - I’m glad it was helpful! Thank you for raising this in the first place so I had somewhere to start :D
wohali: photograph of Joan (Default)

[personal profile] wohali 2018-01-02 07:08 pm (UTC)(link)
Posting only to say that the idea of an XML role-playing game is twisted, meaning I am vaguely interested. :P