I am using JoeBlogs https://github.com/alexjamesbrown/JoeBlogs to handle stuff on some of my wordpress websites. I am having some problems with creating a new category and uploading a picture.
Here is my code for creating a new category:
var wpWrapper = new WordPressWrapper("http://192.168.1.2/xmlrpc.php", "admin", "admin");
wpWrapper.NewCategory("some description", 0, "cat1", "slug here");
I am getting the following error from CookComputing library:
XmlRpcServerException: Not Found
I get the same error for uploading a picture. I've tried 2 versions of uploading a picture with uploadfile and newmediaobject. Here is what I've made with the newmediaobject:
var blog = new WordPressWrapper("http://192.168.1.2/wordpress", "admin", "admin");
byte[] imageData = System.IO.File.ReadAllBytes("desert.jpg");
var img = blog.NewMediaObject(new MediaObject { Bits = imageData, Name = "desert.jpg", Type = "image/jpeg" });
I am getting this error: Response from server does not contain valid XML
Here is my second try with uploadfile:
var blog = new WordPressWrapper("http://192.168.1.2/wordpress", "admin", "admin");
wpWrapper.UploadFile("desert.jpg", "desert.jpg", true,"image/jpeg");
I am getting the same error, with the invalid XML (just like the first try with mediaobject).
What do you guys suggest ?
I am open to other libraries that could help me achieve this.