@@ -26,6 +26,7 @@ namespace boost { namespace network { namespace http {
26
26
typedef basic_request<Tag> request;
27
27
typedef basic_response<Tag> response;
28
28
typedef basic_client_impl<Tag,version_major,version_minor> pimpl_type;
29
+ typedef function<void (iterator_range<char const *> const &,system::error_code const &)> body_callback_function_type;
29
30
30
31
template <class ArgPack >
31
32
basic_client_facade (ArgPack const & args)
@@ -42,11 +43,18 @@ namespace boost { namespace network { namespace http {
42
43
}
43
44
44
45
BOOST_PARAMETER_MEMBER_FUNCTION ((response const ), head, tag, (required (request,(request const &)))) {
45
- return pimpl->request_skeleton (request, " HEAD" , false );
46
+ return pimpl->request_skeleton (request, " HEAD" , false , body_callback_function_type () );
46
47
}
47
48
48
- BOOST_PARAMETER_MEMBER_FUNCTION ((response const ), get , tag, (required (request,(request const &)))) {
49
- return pimpl->request_skeleton (request, " GET" , true );
49
+ BOOST_PARAMETER_MEMBER_FUNCTION ((response const ), get , tag,
50
+ (required
51
+ (request,(request const &))
52
+ )
53
+ (optional
54
+ (body_handler,(body_callback_function_type),body_callback_function_type())
55
+ )
56
+ ) {
57
+ return pimpl->request_skeleton (request, " GET" , true , body_handler);
50
58
}
51
59
52
60
BOOST_PARAMETER_MEMBER_FUNCTION ((response const ), post, tag,
@@ -56,6 +64,7 @@ namespace boost { namespace network { namespace http {
56
64
(optional
57
65
(body,(string_type const &),string_type())
58
66
(content_type,(string_type const &),string_type())
67
+ (body_handler,(body_callback_function_type),body_callback_function_type())
59
68
)
60
69
) {
61
70
if (body != string_type ()) {
@@ -76,7 +85,7 @@ namespace boost { namespace network { namespace http {
76
85
request << header (" Content-Type" , content_type);
77
86
}
78
87
}
79
- return pimpl->request_skeleton (request, " POST" , true );
88
+ return pimpl->request_skeleton (request, " POST" , true , body_handler );
80
89
}
81
90
82
91
BOOST_PARAMETER_MEMBER_FUNCTION ((response const ), put , tag,
@@ -86,6 +95,7 @@ namespace boost { namespace network { namespace http {
86
95
(optional
87
96
(body,(string_type const &),string_type())
88
97
(content_type,(string_type const &),string_type())
98
+ (body_handler,(body_callback_function_type),body_callback_function_type())
89
99
)
90
100
) {
91
101
if (body != string_type ()) {
@@ -106,15 +116,18 @@ namespace boost { namespace network { namespace http {
106
116
request << header (" Content-Type" , content_type);
107
117
}
108
118
}
109
- return pimpl->request_skeleton (request, " PUT" , true );
119
+ return pimpl->request_skeleton (request, " PUT" , true , body_handler );
110
120
}
111
121
112
122
BOOST_PARAMETER_MEMBER_FUNCTION ((response const ), delete_, tag,
113
123
(required
114
124
(request,(request const &))
115
125
)
126
+ (optional
127
+ (body_handler,(body_callback_function_type),body_callback_function_type())
128
+ )
116
129
) {
117
- return pimpl->request_skeleton (request, " DELETE" , true );
130
+ return pimpl->request_skeleton (request, " DELETE" , true , body_handler );
118
131
}
119
132
120
133
void clear_resolved_cache () {
0 commit comments