有人知道我做错了吗?
var service = new Service("lh2", "exampleCo-exampleApp-1");
service.setUserCredentials("myuser", "mypass");
var myPhoto = new PhotoEntry
{
Title = new AtomTextConstruct(
AtomTextConstructElementType.Title,
"Puppies FTW")
};
var myMedia = new MediaFileSource(@"C:\puppies.jpg", "image/jpeg");
myPhoto.MediaSource = myMedia;
var u="https://picasaweb.google.com/data/feed/api/user/default/albumid/default";
var returnedPhoto = service.Insert(new Uri(u), myPhoto);
实际上是使用以下响应字符串返回错误请求错误(400):必须包含照片数据或来源ID
答案 0 :(得分:1)
返回错误是因为Uri错了:
我必须使用:
var u="https://picasaweb.google.com/data/media/api/user/default/albumid/default";
代替:
var u="https://picasaweb.google.com/data/feed/api/user/default/albumid/default";