I know there are XML-RPC libraries that I should be using but that's no fun.
So here is my attempt to authenticate to api.webfaction.com with my control panel un and pw using php.
The result I get is:
The four variables are set, just not included here.
What simple thing am I missing?
You need to trim the newline from the beginning of
answered 09 Mar, 22:34
Thank you. That did indeed work.
For anyone who stumbles across this in a Google search, the payload can more easily be built using 'xmlrpc_encode_request':
The machine name needs to be capitalized: Web555 not web555.
Version only needs to be included if you want version 2. Version 1 is default. (as of March 2017)
Note: the parameters need to be in the correct order as shown.
Also I had a user agent in my header. This doesn't seem to be necessary.
To save you further frustration, The php manual for stream_context_create contains simples examples for doing this using 'fopen' and 'file_get_contents'.