1 message in com.googlegroups.bloggerdev[bloggerDev] Re: Unsupported media type| From | Sent On | Attachments |
|---|---|---|
| Jeff Scudder | 22 Apr 2008 09:52 |
| Subject: | [bloggerDev] Re: Unsupported media type![]() |
|---|---|
| From: | Jeff Scudder (j....@google.com) |
| Date: | 04/22/2008 09:52:22 AM |
| List: | com.googlegroups.bloggerdev |
On Apr 19, 8:00 am, Roland <rola...@gmail.com> wrote:
Hello,
I'm trying to use Blogger Data API to update a posts in my blog.
Basically I'm using Java Developer guide to achive
thathttp://code.google.com/apis/blogger/developers_guide_java.html#Updati...
with following code:
public String updatePost(Blog post,String login,String password){
try {
//set credentials
setCredentials(login, password);
//recieving entry to be updated
Entry entry = getEntryById(post.getPostId());
if (entry == null)
return "Vastava identifikaatoriga postitus
puudub";
entry.setTitle(new PlainTextConstruct(post.getTitle()));
entry.setContent(new PlainTextConstruct("Mine pekki")); Link link = entry.getEditLink(); URL editUrl = new URL(link.getHref()); myService.update(editUrl, entry); } catch (Exception e) { log.error(e.getMessage()); e.printStackTrace(); return e.getMessage(); } return "OK"; }
But all I get is com.google.gdata.util.ServiceException: Unsupported Media Type Content-Type text/html;charset=UTF-8 is not valid.
Which looks normal to me.
What should I make differently to make this work
Thanks in advance, Roland
Hi Roland,
I didn't see any issues in the code that you provided. Perhaps the issue is with the String returned from post.getTitle(). Could I see that code, or better yet, a wireshark packet trace? Sometimes it is easiest to see the issue by looking at the bytes which are sent over the wire.
Thank you,
Jeff
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Blogger Data API" group.
To post to this group, send email to blog...@googlegroups.com
To unsubscribe from this group, send email to
blog...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bloggerDev?hl=en
-~----------~----~----~----~------~----~------~--~---




