@@ -612,6 +612,7 @@ using Ranges = std::vector<Range>;
612612struct Request {
613613 std::string method;
614614 std::string path;
615+ Params params;
615616 Headers headers;
616617 std::string body;
617618
@@ -623,7 +624,6 @@ struct Request {
623624 // for server
624625 std::string version;
625626 std::string target;
626- Params params;
627627 MultipartFormDataMap files;
628628 Ranges ranges;
629629 Match matches;
@@ -7420,7 +7420,7 @@ inline bool ClientImpl::send(Request &req, Response &res, Error &error) {
74207420inline bool ClientImpl::is_ssl_peer_could_be_closed (SSL *ssl) const {
74217421 char buf[1 ];
74227422 return !SSL_peek (ssl, buf, 1 ) &&
7423- SSL_get_error (ssl, 0 ) == SSL_ERROR_ZERO_RETURN;
7423+ SSL_get_error (ssl, 0 ) == SSL_ERROR_ZERO_RETURN;
74247424}
74257425#endif
74267426
@@ -7438,9 +7438,7 @@ inline bool ClientImpl::send_(Request &req, Response &res, Error &error) {
74387438
74397439#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
74407440 if (is_alive && is_ssl ()) {
7441- if (is_ssl_peer_could_be_closed (socket_.ssl )) {
7442- is_alive = false ;
7443- }
7441+ if (is_ssl_peer_could_be_closed (socket_.ssl )) { is_alive = false ; }
74447442 }
74457443#endif
74467444
@@ -7799,7 +7797,13 @@ inline bool ClientImpl::write_request(Stream &strm, Request &req,
77997797 {
78007798 detail::BufferStream bstrm;
78017799
7802- const auto &path = url_encode_ ? detail::encode_url (req.path ) : req.path ;
7800+ const auto &path_with_query =
7801+ req.params .empty () ? req.path
7802+ : append_query_params (req.path , req.params );
7803+
7804+ const auto &path =
7805+ url_encode_ ? detail::encode_url (path_with_query) : path_with_query;
7806+
78037807 detail::write_request_line (bstrm, req.method , path);
78047808
78057809 header_writer_ (bstrm, req.headers );
0 commit comments