File: ssecli.cc

package info (click to toggle)
cpp-httplib 0.11.4%2Bds-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,236 kB
  • sloc: cpp: 12,387; makefile: 109; python: 50; sh: 16
file content (21 lines) | stat: -rw-r--r-- 381 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//
//  ssecli.cc
//
//  Copyright (c) 2019 Yuji Hirose. All rights reserved.
//  MIT License
//

#include <httplib.h>
#include <iostream>

using namespace std;

int main(void) {
  httplib::Client("http://localhost:1234")
      .Get("/event1", [&](const char *data, size_t data_length) {
        std::cout << string(data, data_length);
        return true;
      });

  return 0;
}