WordPress Error uploading image: 401 API Python Script

When you’re using Basic Authentication, you can’t just pass the {username}:{password} string; you need to base64-encode it. libcurl docs on Basic Auth So your line ‘Authorization’: ‘Basic ‘ + WP_USER + ‘:’ + WP_APPLICATION_PASSWORD should be more like ‘Authorization’: ‘Basic ‘ + base64( WP_USER + ‘:’ + WP_APPLICATION_PASSWORD ) (I don’t know how Python does … Read more

How do I return XML to an API post request

because you don’t return JSON, you can use admin-post.php. create a hook like that : add_action(“admin_post_nopriv_MY_PLUGIN__answer”, function () { header(“Content-type: text/xml”); echo “<abc><def>1</def></abc>”; exit(); }); and then use the url /wp-admin/admin-post.php?action=MY_PLUGIN__answer. when you do debugging, don’t forget that admin_post_nopriv only answers on unconnected users then you can open the url in another browser.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)