param_vec_t *_params, std::optional<std::string> _api_name) : RGWRESTStreamRWRequest(_cct, "HEAD", _url, _cb, _headers, _params, _api_name) {}
};
+class RGWRESTStreamSendRequest : public RGWRESTStreamRWRequest {
+public:
+ RGWRESTStreamSendRequest(CephContext *_cct, const string& method, const string& _url,
+ ReceiveCB *_cb, param_vec_t *_headers, param_vec_t *_params,
+ std::optional<std::string> _api_name,
+ HostStyle _host_style = PathStyle) : RGWRESTStreamRWRequest(_cct, method, _url, _cb, _headers, _params, _api_name, _host_style) {}
+};
+
class RGWRESTStreamS3PutObj : public RGWHTTPStreamRWRequest {
std::optional<std::string> api_name;
HostStyle host_style;
return req.complete_request(y);
}
+int RGWRESTConn::send_resource(const DoutPrefixProvider *dpp, const string& method,
+ const string& resource, rgw_http_param_pair *extra_params,
+ map<string, string> *extra_headers, bufferlist& bl,
+ bufferlist *send_data, RGWHTTPManager *mgr, optional_yield y)
+{
+ string url;
+ int ret = get_url(url);
+ if (ret < 0)
+ return ret;
+
+ param_vec_t params;
+
+ if (extra_params) {
+ params = make_param_list(extra_params);
+ }
+
+ populate_params(params, nullptr, self_zone_group);
+
+ RGWStreamIntoBufferlist cb(bl);
+
+ RGWRESTStreamSendRequest req(cct, method, url, &cb, NULL, ¶ms, api_name, host_style);
+
+ map<string, string> headers;
+ if (extra_headers) {
+ headers.insert(extra_headers->begin(), extra_headers->end());
+ }
+
+ ret = req.send_request(dpp, &key, headers, resource, mgr, send_data);
+ if (ret < 0) {
+ ldpp_dout(dpp, 5) << __func__ << ": send_request() resource=" << resource << " returned ret=" << ret << dendl;
+ return ret;
+ }
+
+ return req.complete_request(y);
+}
+
RGWRESTReadResource::RGWRESTReadResource(RGWRESTConn *_conn,
const string& _resource,
const rgw_http_param_pair *pp,
RGWHTTPManager *mgr,
optional_yield y);
+ int send_resource(const DoutPrefixProvider *dpp,
+ const string& method,
+ const string& resource,
+ rgw_http_param_pair *extra_params,
+ map<string, string>* extra_headers,
+ bufferlist& bl,
+ bufferlist *send_data,
+ RGWHTTPManager *mgr,
+ optional_yield y);
+
template <class T>
int get_json_resource(const DoutPrefixProvider *dpp, const std::string& resource, param_vec_t *params,
bufferlist *in_data, optional_yield y, T& t);