Skip to content

Commit 86a6b69

Browse files
authored
Add: Code-block
1 parent 74a630c commit 86a6b69

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

+25
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
11
# curl4cpp
22
## single header cURL wrapper for C++ around libcURL.
33

4+
### An example:
5+
```cpp
6+
#include <iostream>
7+
#include <string>
8+
#include "curl4.hpp"
9+
10+
int main() {
11+
curl4::CURL4 init = curl4::easy::init();
12+
13+
{
14+
std::string val;
15+
16+
init.setopt(CURLOPT_URL, "https://raw.githubusercontent.com/ferhatgec/bufsize/master/example.cpp");
17+
init.setopt(CURLOPT_WRITEFUNCTION, curl4::easy::writefunc);
18+
init.setopt(CURLOPT_WRITEDATA, &val);
19+
20+
CURLcode res = curl4::easy::perform(init);
21+
22+
std::cout << val << '\n';
23+
}
24+
25+
return 0;
26+
}
27+
```
28+
429
### curl4cpp licensed under the terms of MIT License.

0 commit comments

Comments
 (0)