File: httpclient-sample.cc

package info (click to toggle)
gpsshogi 0.7.0-3.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 111,280 kB
  • sloc: cpp: 80,962; perl: 12,610; ruby: 3,929; javascript: 1,631; makefile: 1,202; sh: 473; tcl: 166; ansic: 67
file content (21 lines) | stat: -rw-r--r-- 477 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * A sample program to use the PocoNet functionarities.
 * It connects to a web site and saves the content to a file.
 */

#include "httpclient.h"
#include "Poco/Net/HTTPStreamFactory.h"
#include <string>

using namespace std;

int main(int argc, char **argv)
{
  const string url = "http://wdoor.c.u-tokyo.ac.jp/shogi/";
  const string filename = "./test.html";

  Poco::Net::HTTPStreamFactory::registerFactory();
  gpsshell::getFileOverHttp(url, filename);

  return 0;
}