2012-02-07 125 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

回答