Commit Graph

363 Commits

Author SHA1 Message Date
yhirose
d03937e144 Content receiver support on server 2019-10-27 23:20:56 -04:00
yhirose
5f32c424c2 Content provider support on client 2019-10-25 18:39:04 -04:00
yhirose
0d527e2b83 Code formatting 2019-10-25 12:09:26 -04:00
yhirose
bea3ebd7af Added 'compress' option to POST, PUT and PATCH. 2019-10-25 11:46:12 -04:00
yhirose
001b8a5529 Added unit tests 2019-10-22 23:32:14 -04:00
yhirose
dcdb0d047b Fixed PRI request problem 2019-10-03 13:44:18 -04:00
yhirose
6d8302313c Fixed warning 2019-10-03 13:44:18 -04:00
Shunsuke Mie
5f49c13f95 Fix a test, ConnectionErrorTest::InvalidPort. currently, the abcde.com is valid, so I change it. The first byte doesn't permit a hyphen. 2019-10-03 21:49:11 +09:00
yhirose
a99e02aeb3 Add HTTP/2 Connection Preface check test 2019-10-01 06:28:45 -04:00
Steffen Schuemann
7e92ffec48 Added new Client::Get variant that combines a ContentReceiver with a new ResponseHandler
While trying to implement streaming of internet radio, where a ContentReceiver is needed to handle the audio data, I had the problem, that important information about the stream data is part of the HTTP header (e.g. size of audio chunks between meta data), so I added a ResponseHandler and a new Get variant, to gain access to the header before handling the first chunk of data.

The ResponseHandler can abort the request by returning false, in the same way as the ContentReceiver.

A test case was also added.
2019-09-14 14:55:12 +02:00
yhirose
531708816a Update README 2019-09-06 18:29:22 -04:00
yhirose
bfec81998b Code cleanup 2019-09-06 18:16:42 -04:00
yhirose
c9238434e1 Added redirect support (Fix #211) 2019-09-06 18:07:35 -04:00
yhirose
a0fe91e84d Fixed unit test problem 2019-09-03 17:16:07 -04:00
yhirose
80f040cf69 Fix #209 2019-09-03 17:10:04 -04:00
yhirose
1e82359329 Keep-alive connection support on client (Fix #36) 2019-08-31 17:52:24 -04:00
yhirose
64991a560a Fixed problems with Win32 build 2019-08-07 15:21:22 +09:00
yhirose
d7bb402ca7 Format code 2019-08-06 18:12:05 +09:00
yhirose
2823a94fc1 Added 'resource_releaser' for content provider 2019-08-05 09:40:23 +09:00
yhirose
5a13539e57 Revert "Fixed unit test error on Windows"
This reverts commit 531f6ab84d.
2019-08-04 09:50:47 +09:00
yhirose
531f6ab84d Fixed unit test error on Windows 2019-08-03 20:43:27 -04:00
yhirose
c899462e75 Added 'Content-Range' header for single range request 2019-08-03 22:12:24 +09:00
yhirose
9d7b717504 Range header support and redesign of content provider interface 2019-08-03 03:28:39 +09:00
yhirose
e8799383f3 Made unit tests stable 2019-07-30 01:51:53 +00:00
yhirose
ba7f9fe4c3 Added more unit tests 2019-07-28 19:11:58 -04:00
yhirose
34651ef89b Fix #121 2019-07-23 09:53:44 -04:00
yhirose
e0d327558d Updated README 2019-07-23 08:05:51 -04:00
yhirose
b5a1d52f36 Test code cleanup 2019-07-19 11:47:08 -04:00
yhirose
eaafa5d55c Fix #127 2019-07-19 11:38:06 -04:00
yhirose
6f663028e9 Fix #139. Content receiver support 2019-07-17 22:00:18 -04:00
yhirose
1981e0ccad Add SSL object on Request 2019-06-20 18:52:28 -04:00
yhirose
8d12e0d8f4 Simplified code 2019-06-11 21:39:35 -04:00
yhirose
07d9843b91 clangformat 2019-06-11 20:57:02 -04:00
PixlRainbow
b2f4120d15 setup test cases for client certificates 2019-06-07 01:23:22 +08:00
yhirose
dfc94f2cab Code cleanup 2019-05-07 21:46:15 -04:00
yhirose
3f42804a4f Wildcard support for verifying server certificate. fix #87 2019-05-07 21:40:03 -04:00
yhirose
744e8e7071 Fix #144 2019-04-12 23:34:27 -04:00
yhirose
8af85019dc Removed get_header_value_int and use uint64_t for the return value of get_header_value_uint64 2019-04-12 17:22:39 -04:00
Yuji Hirose
5d082f1da4 Apply clangformat 2019-04-11 08:13:31 -04:00
yhirose
a91a0b7dbf Fix #140 2019-04-10 12:21:42 -04:00
yhirose
8483e5931f Fix #136 2019-03-28 19:56:32 -04:00
Yuji Hirose
96cacd24f9 Fixed #134 2019-03-12 08:49:08 -04:00
yhirose
3a3b02e2e5 Added Base Authentication test 2019-02-14 22:51:17 -05:00
Yuji Hirose
d3eb88b740 Fix #126 2019-02-13 08:14:58 -05:00
yhirose
b5927aec12 fix #116 2018-12-17 21:07:38 -05:00
yhirose
86b3dfc480 fix #110 2018-11-30 21:18:35 -05:00
yhirose
76ea8dd560 Added LongQueryValue test 2018-11-14 17:35:27 -05:00
yhirose
4d7cee81eb Fix #95 2018-09-23 12:02:17 -04:00
Thomas Tissot
82fc7d5591 Request cancelation feature
This commit modifies the signature of the `Progress` callback
so that its return value will indicate whether the request shall
continue to be processed by returning `true`, or if it shall
be aborted by returning `false`. Such modification will allow
one to cancel an ongoing request before it has completed.

When migrating, developers should modify there `Progress`
callbacks to always return `true` by default in case there
do not want to benefit from the cancelation feature.

A few unit tests use cases were provided, but anyone should feel
free to provide additional uses cases that they find relevant.
2018-08-06 11:54:52 +02:00
David Guillen Fandos
dae4124039 Implementing streaming Responses
This enables a much easier handling of big queries after all.
2018-08-01 23:53:01 +02:00
David Guillen Fandos
ca343ae1d8 Fix small issues in tests and added some extra checks. 2018-07-31 22:08:38 +02:00
yhirose
2bb27aa25d Fix #74 2018-06-01 23:05:32 -04:00
yhirose
5b3187e2f9 Fix #72 2018-05-31 22:17:23 -04:00
yhirose
7b9d752583 Fixed problem with connection close 2018-05-14 00:05:14 -04:00
yhirose
312a8d7523 Removed HTTP version. It's now always 'HTTP/1.1'. 2018-05-13 19:18:25 -04:00
yhirose
6c5d0b2a18 Fix #57 and #62 2018-05-08 21:51:41 -04:00
yhirose
6aa3fd6b59 Fix #38 2018-04-20 09:59:19 -04:00
yhirose
5574d82eb3 Made a temporary fix for OpenSSL thread problem 2018-04-20 00:17:51 -04:00
Scott Graham
889041f05f Don't fail chunked read if buffer not yet filled 2018-04-17 22:05:38 -07:00
yhirose
b6df220b55 Fixed #48 2018-04-17 13:10:05 -04:00
yhirose
bc051219f9 Removed is_handling_requests 2018-04-17 13:10:05 -04:00
Scott Graham
ca3613cd21 Make 'chunked' in Transfer-Encoding case-insensitive 2018-04-16 21:43:41 -07:00
yhirose
9dc4e23082 Unit test for #52 2018-04-17 00:05:05 -04:00
yhirose
ebe40a7d94
Merge pull request #50 from sgraham/body-decompress
Support Content-Encoding: gzip on server side
2018-04-16 20:54:25 -04:00
Scott Graham
5579d4d101 Support Content-Encoding: gzip on server side
If the client specifies Content-Encoding: gzip for POST requests,
decompress the body before attempting to parse it.
2018-04-16 15:16:17 -07:00
Scott Graham
0515c6aad6 Support system-assigned port via two part listen()
This fixes #46 by allowing the user to separate the port bind from the
blocking listen(). Two new API functions bind_to_any_port() (which
returns the system-assigned port) and listen_after_bind() are equivalent
to the existing listen().
2018-04-16 08:23:41 -07:00
yhirose
0e239a0014 Fix #47 2018-04-14 18:42:56 -04:00
yhirose
5536d4c1ff Fix #44 2018-04-06 17:02:37 -04:00
yhirose
4e391fdae6 Added a unit test for REMOTE_ADDR 2018-03-13 23:03:54 -04:00
yhirose
b7b3588afb Connection timeout support on Client (Fixed #34) 2018-01-04 20:35:58 -05:00
yhirose
1d5fbe6a5b Add gzip support. resolved #11 2017-12-30 00:00:43 -05:00
yhirose
d1f903fc58 Cleanup test code 2017-12-29 23:09:17 -05:00
yhirose
23c8f0c738 Fixed #28. (Keep-Alive connection support) 2017-12-20 17:32:15 -05:00
yhirose
7e5db48bdf Fixed #33 2017-12-12 22:20:40 -05:00
yhirose
31e53d21e4 Fixed #32 2017-12-10 22:34:37 -05:00
yhirose
6a608b3ed4 Fixed Unit test failures on Windows 2017-12-07 00:05:43 -05:00
yhirose
315c11d6e2 Implemented socket_reader 2017-12-06 23:52:34 -05:00
yhirose
c3346a4815 Changed to use std::multimap for params 2017-12-05 23:19:39 -05:00
yhirose
bb8a1df7a3 Fixed #21 2017-12-05 19:19:07 -05:00
yhirose
4fb2f51766 Fixed #19 2017-12-03 22:31:00 -05:00
yhirose
9bc2883090 Fixed #26 2017-12-03 21:25:38 -05:00
yhirose
e90244e992 Fixed compiler warings (with -Wall and -Wextra) 2017-12-03 08:17:05 -05:00
yhirose
28ba178fee Fixed #27 2017-12-02 10:24:41 -05:00
yhirose
90f9cd40f9 Fixed #3 2017-11-25 22:32:09 -05:00
yhirose
1e3ef46862 Changed to return 'Server&' from 'get' and 'post' 2017-11-25 11:58:09 -05:00
yhirose
2a45bdcd3b Fixed #14 2017-09-07 14:45:02 -04:00
yhirose
5f1ff58ed2 Added unit tests for AI_PASSIVE flag. 2017-08-29 18:41:34 -04:00
yhirose
7cdf62dd31 Fixed build errors and adjusted a test case. 2017-06-28 19:36:48 -04:00
yhirose
22f124f871 Added OpenSSL support. #5 2017-04-21 23:13:30 -04:00
yhirose
efc579b14e Changed to use getaddrinfo. 2015-01-14 18:51:53 -05:00
yhirose
98e3e7b3c1 Changed test and README to use the generic lambda. 2014-03-31 21:07:56 -04:00
yhirose
5c01c69223 fixed path to the current directory. 2013-07-07 20:16:38 -04:00
yhirose
20fa4ba3b4 added return value to set_base_dir. 2013-07-04 22:08:06 -04:00
yhirose
eef74af19b static file support. vc12 support. 2013-07-04 18:18:52 -04:00
yhirose
9c7cd1af71 Changed to use more c++11 features. 2013-05-11 16:11:30 -04:00
yhirose
a1ef364247 Changed to use c++11 features. 2013-04-24 06:09:19 -04:00
yhirose
b5ae7d0e7a Added HEAD method support. 2012-10-12 17:41:58 -04:00
yhirose
448a7f4f11 Fixed format. 2012-10-12 16:28:57 -04:00
yhirose
e8a18ad447 Removed Connection class. 2012-10-12 16:09:39 -04:00
yhirose
3b3828aaff Fixed unit test. Added URL encoding. 2012-10-11 23:52:34 -04:00
yhirose
6062ea592b Refactoring. Removed some client methods. 2012-10-05 13:58:56 -04:00
yhirose
3c8c835489 Added client methods with shared pointer to Response. 2012-10-04 01:18:18 -04:00
yhirose
d187cdef50 Fixed problem with closing socket. 2012-10-04 00:52:12 -04:00
yhirose
e0a25745cf Added post method support. 2012-10-03 23:47:59 -04:00
yhirose
ffde8b7e4b Refactoring. 2012-10-03 21:55:01 -04:00
yhirose
aa75fbb5f9 Refactoring. 2012-10-03 20:11:22 -04:00
yhirose
f91cc98b89 Changed return type of client. 2012-10-02 23:24:23 -04:00
yhirose
42473b722f Code refactoring. 2012-10-02 22:37:14 -04:00
yhirose
762e7938fd Added client. 2012-10-02 20:39:13 -04:00
yhirose
ced9c38339 Renamed Context to Connection. Removed DSL macro. 2012-09-28 18:31:03 -04:00
yhirose
6897c64c74 Renamed project name to 'cpp-httplib'. 2012-09-27 21:05:36 -04:00
yhirose
ac5c13620c Added ServerTest. 2012-09-27 20:55:52 -04:00
yhirose
4781156fa1 Added google test framework. 2012-09-26 21:35:49 -04:00