新浪的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 怎么用进去啊有好心人帮帮忙吗 

解决方案 »

  1.   

    curl是一款linux下的应用程序,支持http协议,如果你没有linux,在windows 下安装cygwin也是有curl这个程序的。
      

  2.   

    其实主要想知道怎么调用API的。新浪微博,如果取得了一些参数,看下我这么组的对吗,一些参数已经获取到了
        //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];
      

  3.   

    新浪微博有现成的objc sdk可用,最好不要自己搞