NetServices: implement hostname resolution and connection for BHttpRequest
BHttpSession::Execute() moves the request into the session, and returns a future BHttpResponse object. Currently implemented are resolving the hostname, and opening the connection. There is some scaffolding for the actual data transfer. Change-Id: I5a8a7a7f8680036b91cdba4beee140bbed6bfd5a
This commit is contained in:
@@ -13,6 +13,16 @@
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
|
||||
|
||||
/*!
|
||||
\file HttpSession.h
|
||||
\ingroup netservices
|
||||
\brief Provides classes and tools to schedule and execute HTTP requests.
|
||||
|
||||
\since Haiku R1
|
||||
*/
|
||||
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
namespace Network {
|
||||
@@ -153,6 +163,26 @@ namespace Network {
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\fn BHttpResult BHttpSession::Execute(BHttpRequest &&request,
|
||||
std::unique_ptr< BDataIO > target=nullptr, BMessenger observer=BMessenger())
|
||||
\brief Schedule and execute a \a request.
|
||||
|
||||
\param request The (valid) request to move from.
|
||||
\param target An optional data buffer to write the incoming body of the request to. This can be
|
||||
\c nullptr if you want to use the default internal storage. If you provide a buffer, it
|
||||
must be wrapped in a \c std::unique_ptr. This means that you transfer ownership to the
|
||||
session. After the request is finished, you can regain ownership.
|
||||
\param observer An optional observer that will receive the progress and status messages for
|
||||
this request.
|
||||
|
||||
\return The \ref BHttpResult object that corresponds to this request, and that can be used to
|
||||
monitor the progress.
|
||||
|
||||
\since Haiku R1
|
||||
*/
|
||||
|
||||
|
||||
} // namespace Network
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
Reference in New Issue
Block a user