poco之HttpRequest之get方法

Poco::Net::HTTPClientSession s("www.cnblogs.com");

 需要引用的头文件是:

#import
#import
#import
#import
#import
#import
#import

 

    Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, "/auroratony/archive/2012/06/06/2537516.html");

    //Poco::Net::HTMLForm form;
    //form.add("entry1", "value1");
    //form.prepareSubmit(request);
    s.sendRequest(request);
    Poco::Net::HTTPResponse response;
   
    std::istream& rs = s.receiveResponse(response);
   
    std::string responseText;
   
    Poco::StreamCopier copier;
    copier.copyToString(rs, responseText);
    NSString* strmsg = [NSString stringWithCString:responseText.c_str()  encoding:NSUTF8StringEncoding];
    NSLog(strmsg);
    std::cout << responseText << std::endl;

你可能感兴趣的:(poco之HttpRequest之get方法)