我試圖上傳到喜愛的視頻在我的帳戶,但它顯示無效請求的URI和狀態碼= 400如何上傳視頻到目標C使用GDATA最愛/播放列表
我不明白應該如何格式化我的請求
我的代碼
NSURL *url = [NSURL URLWithString:
http://gdata.youtube.com/feeds/api/users/username/favorite];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request setPostValue:@"gdata.youtube.com" forKey:@"Host"];
[request setPostValue:@"application/atom+xml" forKey:@"Content-Type"];
[request setPostValue:@"CONTENT_LENGTH" forKey:@"Content-Length"];
[request setPostValue:@"" forKey:@"AuthSubToken"];
[request setPostValue:@"2" forKey:@"GData-Version"];
[request setPostValue:developer_key forKey:@"X-GData-Key"];
[request setPostValue:xml_data forKey:@"API_XML_Request"];
[request setDelegate:self];
[request setDidFailSelector:@selector(requestFailed:)];
[request setDidFinishSelector:@selector(gotTheResponse:)];
[[networkQueue go];
我有身份驗證令牌和開發重點,VIDEO_ID.but不知道如何通過在POST請求的XML數據:
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
<id>VIDEO_ID</id>
</entry>
的NSString * xml_data =包含字符串形式的XML數據
我想添加到您管帳! – Swati 2010-10-28 06:58:26