本文整理汇总了C++中web::http::uri_builder类的典型用法代码示例。如果您正苦于以下问题:C++ uri_builder类的具体用法?C++ uri_builder怎么用?C++ uri_builder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了uri_builder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_service_stats
web::http::http_request get_service_stats(web::http::uri_builder uri_builder, const std::chrono::seconds& timeout, operation_context context)
{
uri_builder.append_query(uri_query_resource_type, resource_service);
uri_builder.append_query(uri_query_component, component_stats);
web::http::http_request request(base_request(web::http::methods::GET, uri_builder, timeout, context));
return request;
}
示例2: delete_message
web::http::http_request delete_message(const cloud_queue& queue, const cloud_queue_message& message, web::http::uri_builder uri_builder, const std::chrono::seconds& timeout, operation_context context)
{
uri_builder.append_query(U("popreceipt"), message.pop_receipt());
web::http::http_request request = queue_base_request(web::http::methods::DEL, uri_builder, timeout, context);
return request;
}
示例3: set_service_properties
web::http::http_request set_service_properties(web::http::uri_builder uri_builder, const std::chrono::seconds& timeout, operation_context context)
{
uri_builder.append_query(core::make_query_parameter(uri_query_resource_type, resource_service, /* do_encoding */ false));
uri_builder.append_query(core::make_query_parameter(uri_query_component, component_properties, /* do_encoding */ false));
web::http::http_request request(base_request(web::http::methods::PUT, uri_builder, timeout, context));
return request;
}
示例4: update_message
web::http::http_request update_message(const cloud_queue& queue, const cloud_queue_message& message, std::chrono::seconds visibility_timeout, bool update_contents, web::http::uri_builder uri_builder, const std::chrono::seconds& timeout, operation_context context)
{
uri_builder.append_query(U("popreceipt"), message.pop_receipt());
uri_builder.append_query(U("visibilitytimeout"), visibility_timeout.count());
web::http::http_request request = queue_base_request(web::http::methods::PUT, uri_builder, timeout, context);
if (update_contents)
{
protocol::message_writer writer;
std::string content = writer.write(message.content_as_string());
request.set_body(content);
}
return request;
}
示例5: update_message
web::http::http_request update_message(const cloud_queue_message& message, std::chrono::seconds visibility_timeout, bool update_contents, web::http::uri_builder& uri_builder, const std::chrono::seconds& timeout, operation_context context)
{
uri_builder.append_query(core::make_query_parameter(_XPLATSTR("popreceipt"), message.pop_receipt()));
uri_builder.append_query(core::make_query_parameter(_XPLATSTR("visibilitytimeout"), visibility_timeout.count(), /* do_encoding */ false));
web::http::http_request request = queue_base_request(web::http::methods::PUT, uri_builder, timeout, context);
if (update_contents)
{
protocol::message_writer writer;
std::string content = writer.write(message);
request.set_body(content);
}
return request;
}
示例6: list_queues
web::http::http_request list_queues(web::http::uri_builder uri_builder, const std::chrono::seconds& timeout, operation_context context)
{
uri_builder.append_query(uri_query_component, component_list);
web::http::http_request request = queue_base_request(web::http::methods::GET, uri_builder, timeout, context);
return request;
}
示例7: list_queues
web::http::http_request list_queues(web::http::uri_builder& uri_builder, const std::chrono::seconds& timeout, operation_context context)
{
uri_builder.append_query(core::make_query_parameter(uri_query_component, component_list, /* do_encoding */ false));
web::http::http_request request = queue_base_request(web::http::methods::GET, uri_builder, timeout, context);
return request;
}
示例8: add_query_if_not_empty
void add_query_if_not_empty(web::http::uri_builder& builder, const utility::string_t& name, const utility::string_t& value, bool do_encoding)
{
if (!value.empty())
{
builder.append_query(core::make_query_parameter(name, value, do_encoding));
}
}
示例9: upload_queue_metadata
web::http::http_request upload_queue_metadata(const cloud_queue& queue, web::http::uri_builder uri_builder, const std::chrono::seconds& timeout, operation_context context)
{
// TODO: Make a copy of needed data so it is OK for the main object class to be destructed mid-operation
uri_builder.append_query(uri_query_component, component_metadata);
web::http::http_request request = queue_base_request(web::http::methods::PUT, uri_builder, timeout, context);
add_metadata(request, queue.metadata());
return request;
}
示例10: add_message
web::http::http_request add_message(const cloud_queue& queue, const cloud_queue_message& message, std::chrono::seconds time_to_live, std::chrono::seconds initial_visibility_timeout, web::http::uri_builder uri_builder, const std::chrono::seconds& timeout, operation_context context)
{
if (time_to_live.count() >= 0LL && time_to_live.count() != 604800LL)
{
uri_builder.append_query(U("messagettl"), time_to_live.count());
}
if (initial_visibility_timeout.count() > 0LL)
{
uri_builder.append_query(U("visibilitytimeout"), initial_visibility_timeout.count());
}
web::http::http_request request = queue_base_request(web::http::methods::POST, uri_builder, timeout, context);
protocol::message_writer writer;
std::string content = writer.write(message.content_as_string());
request.set_body(content);
return request;
}
示例11: base_request
web::http::http_request base_request(web::http::method method, web::http::uri_builder uri_builder, const std::chrono::seconds& timeout, operation_context context)
{
if (timeout.count() > 0)
{
uri_builder.append_query(core::make_query_parameter(uri_query_timeout, timeout.count(), /* do_encoding */ false));
}
web::http::http_request request(method);
request.set_request_uri(uri_builder.to_uri());
web::http::http_headers& headers = request.headers();
headers.add(web::http::header_names::user_agent, header_value_user_agent);
headers.add(ms_header_version, header_value_storage_version);
if (method == web::http::methods::PUT)
{
headers.set_content_length(0);
}
return request;
}
示例12: get_messages
web::http::http_request get_messages(const cloud_queue& queue, size_t message_count, std::chrono::seconds visibility_timeout, bool is_peek, web::http::uri_builder uri_builder, const std::chrono::seconds& timeout, operation_context context)
{
if (is_peek)
{
uri_builder.append_query(U("peekonly=true"));
}
if (message_count > 1U)
{
// The service uses the default value 1
uri_builder.append_query(U("numofmessages"), message_count);
}
if (!is_peek && visibility_timeout.count() > 0LL)
{
uri_builder.append_query(U("visibilitytimeout"), visibility_timeout.count());
}
web::http::http_request request = queue_base_request(web::http::methods::GET, uri_builder, timeout, context);
return request;
}
示例13: get_messages
web::http::http_request get_messages(size_t message_count, std::chrono::seconds visibility_timeout, bool is_peek, web::http::uri_builder& uri_builder, const std::chrono::seconds& timeout, operation_context context)
{
if (is_peek)
{
uri_builder.append_query(_XPLATSTR("peekonly=true"));
}
if (message_count > 1U)
{
// The service uses the default value 1
uri_builder.append_query(core::make_query_parameter(_XPLATSTR("numofmessages"), message_count, /* do_encoding */ false));
}
if (!is_peek && visibility_timeout.count() > 0LL)
{
uri_builder.append_query(core::make_query_parameter(_XPLATSTR("visibilitytimeout"), visibility_timeout.count(), /* do_encoding */ false));
}
web::http::http_request request = queue_base_request(web::http::methods::GET, uri_builder, timeout, context);
return request;
}
示例14: download_queue_metadata
web::http::http_request download_queue_metadata(const cloud_queue& queue, web::http::uri_builder uri_builder, const std::chrono::seconds& timeout, operation_context context)
{
uri_builder.append_query(uri_query_component, component_metadata);
web::http::http_request request = queue_base_request(web::http::methods::HEAD, uri_builder, timeout, context);
return request;
}
示例15: create
pplx::task<etcd::Response> etcd::Client::send_get_request(web::http::uri_builder & uri)
{
return Response::create(client.request(web::http::methods::GET, uri.to_string()));
}