(1)バイナリ以外の項目
GTMMIMEDocument *doc = [GTMMIMEDocument MIMEDocument];
// keywordはNSString
NSMutableDictionary *headers
= [NSMutableDictionary dictionaryWithObject:@"form-data; name=\"keyword\"" forKey:@"Content-Disposition"];
[doc addPartWithHeaders:headers body:[keyword dataUsingEncoding:NSUTF8StringEncoding]];
// entryTextはNSString
headers = [NSMutableDictionary dictionaryWithObject:@"form-data; name=\"status\"" forKey:@"Content-Disposition"];
[doc addPartWithHeaders:headers body:[entryText dataUsingEncoding:NSUTF8StringEncoding]];
(2)リクエストにoauth認証の情報を追加するのは一番最後送信直前にする
NSMutableURLRequest *request
= [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"送信先URL"]];
[request setHTTPMethod:@"POST"];
// ::
// いろいろ
// ::
//authはGTMOAuthAuthentication
[auth authorizeRequest:request];
GTMHTTPFetcher *fetcher = [GTMHTTPFetcher fetcherWithRequest:request];
[fetcher setPostStream:stream];
[fetcher beginFetchWithDelegate:self
didFinishSelector:@selector(送信したあと)];