2012-02-07 121 views
1

添加播放列表的YouTube帐户

POST /feeds/api/playlists/PLAYLIST_ID HTTP/1.1 
Host: gdata.youtube.com 
Content-Type: application/atom+xml 
Content-Length: CONTENT_LENGTH 
Authorization: AuthSub token="AUTHORIZATION_TOKEN" 
GData-Version: 2 
X-GData-Key: key=DEVELOPER_KEY 

<?xml version="1.0" encoding="UTF-8"?> 
<entry xmlns="http://www.w3.org/2005/Atom" 
xmlns:yt="http://gdata.youtube.com/schemas/2007"> 
<id>VIDEO_ID</id> 
<yt:position>1</yt:position> 
</entry> 

的YouTube帐户遭到删除播放列表

DELETE /feeds/api/users/USERNAME/playlists/PLAYLIST_ID HTTP/1.1 
Host: gdata.youtube.com 
Content-Type: application/atom+xml 
Authorization: AuthSub token="AUTHORIZATION_TOKEN" 
GData-Version: 2 
X-GData-Key: key=DEVELOPER_KEY 

如何发送这不但方法到YouTube服务器IOS,并得到结果。 IHAVE所有需要的数据(例如令牌和allthat),但idont知道如何发这个帖子,并删除方法服务器,如果你只使用谷歌的API在你的项目,你可以使用的GData Objective-C的客户端库得到响应后和删除方法为iOS设备

+0

NSURLConnection的 – 2012-02-07 04:32:48

+0

是的,我知道,但如何? – 2012-02-07 04:38:24

+0

myreqmutable = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:del]]; [myreqmutable setHTTPMethod:@“DELETE”]; [myreqmutable setValue:@“application/atom + xml”forHTTPHeaderField:@“Content-Type”]; [myreqmutable setValue:@“2”forHTTPHeaderField:@“GData-Version”]; NSURLResponse * response = nil; NSError * error = nil; NSData * result = [NSURLConnection sendSynchronousRequest:myreqmutable returningResponse:&response error:&error]; – 2012-02-07 04:43:32

回答