Trying to interface w/ Google's Blogger
So I'm trying to post to a Blogger account, following Blogger's API instructions on Google's developer's guide. My problem arises in trying to send xml data via POST.
(Yes, I know that I could download and use Google's java classes to do this. I can't rest until I figure out what's going wrong, though.)
I try to access http://www.blogger.com/feeds/[blogId]/posts/default with a URLConnection object as follows.
Then I try to pass the sample xml document provided on the developer's guide page:
URLConnection c = new URL(http://www.blogger.com/feeds/[I][blogId][/I]/posts/default).openConnection();
c.setRequestProperty("Authorization", "GoogleLogin: auth="+[I][auth key][/I]);
...Then get the response:
OutputStreamWriter out = new OutputStream(c.getOutputStream());
But at this point I get a 403 error.
BufferedReader in = new BufferedReader(new InputStreamReader(c.getInputStream()));
Am I sending the data correctly, writing it as a string?
Am I failing to set the content type? When I check my connection's content type using c.getContentType(), it doesn't show up as xml but rather text/plain.