Jumblr Api Gives Bad Request While Posting Image To Tumblr
Solution 1:
I've encountered the same issue using Jumblr.
Instead of this method (does it somehow trigger Android gallery? Couldn't find any javadoc for Methods.FILE_IMAGE)
photoPost.setPhoto(newPhoto(Methods.FILE_IMAGE));
I suggest you to try any flavor of
photoPost.setData(newFile(fileName)); //if it's possible on Android
And please try it with different files: Tumblr has not only file-size limitations, but also some weird check for file being valid. ~3% of gif files I upload throw Bad Request Response code :400. Those files are not exceeding GIF size limit and they're displayed fine on my machine, but Tumblr, for some reason rejects them, so please try post.setData and try it with some bulletproof-valid file, because from the rest of your code - it definitely looks like you're doing it right
Solution 2:
I had a similar problem posting a video & audio. However, posting an Image worked like a charm..
JumblrClientclient=newJumblrClient(
CONSUMER_KEY,
SECRET_KEY
);
client.setToken(
TOKEN,
TOKEN_SECRET
);
PhotoPostpost= client.newPost(strBlogName, PhotoPost.class);
post.setCaption("This is my caption");
post.setData(newFile(fileUri.getPath()));
post.save(); //Initiates upload of image file
Post a Comment for "Jumblr Api Gives Bad Request While Posting Image To Tumblr"