Skip to content

Commit 893fe91

Browse files
authored
Update README.md
1 parent 4d9940d commit 893fe91

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A tiny library using [WinInet](https://docs.microsoft.com/en-us/windows/win32/wininet/about-wininet) for HTTP(S) requests in C++. As WinInet is a native windows library, there are no dependencies, and WNetWrap is very lightweight compared to other libraries like [CPR](https://github.com/whoshuu/cpr).
44

5-
⚠️ This repo uses MS Visual Studio for the example, but *you don't need that to use WNetWrap* - all you need to do is put the `wnetwrap.h` and `wnetwrap.cpp` in your project folder, and include as in the example below.
5+
This repo uses MS Visual Studio for the example, but *you don't need that to use WNetWrap* - all you need to do is put the `wnetwrap.h` and `wnetwrap.cpp` in your project folder, and include as in the example below.
66

77
# Basic HTTP GET request
88

@@ -20,7 +20,17 @@ int main()
2020
cout << my_response.text << endl; //very basic html parser
2121
}
2222
```
23+
24+
URL query parameters can be passed as normal - here is a Google search as an example: <br>
25+
`resp my_response = HttpsRequest("https://www.google.com/search?q=testing+123", my_request);`
2326
27+
28+
# Downloading a file
29+
30+
To download the contents of the request you simply add a third parameter to HttpsRequest. If this parameter value is "dl" then the file is downloaded with its original filename, otherwise the value provided will be the new file's name. For example, to download the CPR library: <br><br>
31+
`resp my_response = HttpsRequest("https://github.com/whoshuu/cpr/archive/refs/tags/1.6.0.zip", my_request, "dl");`
32+
<br><br>
33+
When you download a file, the .raw and .text properties of the response object will be returned empty.
2434
# Preparing the request
2535
2636
The `req` request object is used and can be used for the following (all inputs are strings)

0 commit comments

Comments
 (0)