新浪的API文档发表一条微博的示例:XML
curl -u "username:password" -d 'status=abc&annotations=[{"type2":123}]' "http://api.t.sina.com.cn/statuses/update.xml?source=appkey"
JSON
curl -u "username:password" -d 'status=abc&annotations=[{"type2":123}]' "http://api.t.sina.com.cn/statuses/update.json?source=appkey"
但不知道怎么用 这是什么意思啊,已取得的oauth_token 怎么用进去啊有好心人帮帮忙吗
curl -u "username:password" -d 'status=abc&annotations=[{"type2":123}]' "http://api.t.sina.com.cn/statuses/update.xml?source=appkey"
JSON
curl -u "username:password" -d 'status=abc&annotations=[{"type2":123}]' "http://api.t.sina.com.cn/statuses/update.json?source=appkey"
但不知道怎么用 这是什么意思啊,已取得的oauth_token 怎么用进去啊有好心人帮帮忙吗
解决方案 »
- 那位大深帮忙解决一下iphong编程时出错了,这是哪儿出错了怎么解决 啊
- OC中的sortUsingSelector方法是怎么用的?
- 我的interface builder里为什么没有库
- gcc怎样编译Objective-C程序?
- 请问这种场景下,如何通过performSegueWithIdentifier:sender:来控制跳转
- 求UIImagePickerController 调用设备的摄像头录像Demo或讲解地址
- 苹果会员过期,app问题
- 求助!ios的safari显示问题!
- iOS 像手机QQ分组的那样多层次列表怎么区分点击事件?
- A控制器跳转B控制器,B控制器黑屏?
- TabBarController的问题
- 新手学IPhone,几个问题请教下
//prepar request
NSString *urlString = [NSString stringWithFormat:@" http://api.t.sina.com.cn/statuses/update.json?"];
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
[request setURL:[NSURL URLWithString:urlString]];
[request setHTTPMethod:@"POST"];
//create the body
NSString *xmlContents = [[NSString alloc] initWithFormat:@"oauth_consumer_key=%@&oauthToken=%@&oauth_signature_method=%@&oauth_signature=%@&oauth_timestamp=%@&oauth_nonce=%@&oauth_version=1.0&status=发微博内容", oauth_consumer_key,oauthToken,oauth_signature_method,oauth_signature,oauth_timestamp,oauth_nonce];
NSMutableData *postBody = [NSMutableData data];
[postBody appendData:[xmlContents dataUsingEncoding:NSUTF8StringEncoding]];
//post上微博发表请求
[request setHTTPBody:postBody];