Поделиться через


Метод http_client::request

Асинхронно отправляет HTTP-запрос.

_ASYNCRTIMP pplx::task<http_response> request(
   http_request request
);

pplx::task<http_response> request(
   method mtd
);

pplx::task<http_response> request(
   method mtd,
   const utility::string_t &path_query_fragment
);

pplx::task<http_response> request(
   method mtd,
   const utility::string_t &path_query_fragment,
   const json::value &body_data
);

pplx::task<http_response> request(
   method mtd,
   const utility::string_t &path_query_fragment,
   const utility::string_t &body_data,
   utility::string_t content_type = U("text/plain")
);

pplx::task<http_response> request(
   method mtd,
   const utility::string_t &path_query_fragment,
   concurrency::streams::istream body,
   utility::string_t content_type = U("application/octet-stream")
);

pplx::task<http_response> request(
   method mtd,
   const utility::string_t &path_query_fragment,
   concurrency::streams::istream body,
   size_t content_length,
   utility::string_t content_type= U("application/octet-stream")
);

Параметры

  • request
    Отправляемый запрос.

  • mtd
    Метод HTTP-запроса.

  • path_query_fragment
    Строка, содержащая путь, запрос и фрагмент, относительно базового URI http_client.

  • body_data
    Строка, содержащая текст для использования в теле сообщения.

  • content_type
    Строка, содержащая тип MIME тела сообщения.

  • body
    Асинхронный поток, представляющий данные тела.

  • content_length
    Размер текста сообщения.

Возвращаемое значение

Асинхронная операция, которая выполняется, когда ответ на запрос получен.

Требования

Заголовок: http_client.h

Пространство имен: web::http::client

См. также

Ссылки

Класс http_client