如何上傳用相機拍攝的視頻或手機內存中包含的視頻? 我需要使用PUT方法上傳它。用PUT方式上傳用iphone攝像頭拍攝的視頻
謝謝
代碼上傳照片:
- (void)uploadPhoto:(NSData *)data
{
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setRequestMethod:@"PUT"];
[request addRequestHeader:@"Date" value:timeStamp];
[request addRequestHeader:@"Auth" value:signature];
[request addRequestHeader:@"Client" value:apiClient];
[request addRequestHeader:@"Accept" value:apiAccept];
[request addRequestHeader:@"USER" value:userHeader];
[request appendPostData:data];
[request setDelegate:self];
[request startAsynchronous];
}
- (void)requestFinished:(ASIHTTPRequest *)request
{
// Use when fetching text data
NSString *responseString = [request responseString];
NSLog(@"%@",responseString);
// Use when fetching binary data
NSData *responseData = [request responseData];
NSLog(@"%@",responseData);
}
- (void)requestFailed:(ASIHTTPRequest *)request
{
NSError *error = [request error];
NSLog(@"%@",error);
}
沒有在年底的3種方法被稱爲後,我提出這個要求。 請幫幫我。 問候,
響應字符串:
|?xml version="1.0" encoding="UTF-8"?|
|error|
|code|InvalidParameter|/code|
|message|Invalid parameter specified (user)|/message|
|/error|
是否需要保留請求? (我不知道;也許ASIHTTPRequest保留在操作隊列上。) –