1ec865cb8SNiels Sascha Reedijk/* 2ec865cb8SNiels Sascha Reedijk * Copyright 2022 Haiku, Inc. All rights reserved. 3ec865cb8SNiels Sascha Reedijk * Distributed under the terms of the MIT License. 4ec865cb8SNiels Sascha Reedijk * 5ec865cb8SNiels Sascha Reedijk * Authors: 6ec865cb8SNiels Sascha Reedijk * Niels Sascha Reedijk, niels.reedijk@gmail.com 7ec865cb8SNiels Sascha Reedijk * 8ec865cb8SNiels Sascha Reedijk * Corresponds to: 9ec865cb8SNiels Sascha Reedijk * headers/private/netservices2/HttpRequest.h hrev????? 10ec865cb8SNiels Sascha Reedijk * src/kits/network/libnetservices2/HttpRequest.cpp hrev????? 11ec865cb8SNiels Sascha Reedijk */ 12ec865cb8SNiels Sascha Reedijk 13ec865cb8SNiels Sascha Reedijk 14ec865cb8SNiels Sascha Reedijk#if __cplusplus >= 201703L 15ec865cb8SNiels Sascha Reedijk 16ec865cb8SNiels Sascha Reedijk 17ec865cb8SNiels Sascha Reedijk/*! 18ec865cb8SNiels Sascha Reedijk \file HttpRequest.h 19ec865cb8SNiels Sascha Reedijk \ingroup netservices 20ec865cb8SNiels Sascha Reedijk \brief Provides the classes and tools to build HTTP Requests. 21ec865cb8SNiels Sascha Reedijk 22ec865cb8SNiels Sascha Reedijk \since Haiku R1 23ec865cb8SNiels Sascha Reedijk*/ 24ec865cb8SNiels Sascha Reedijk 25ec865cb8SNiels Sascha Reedijk 26ec865cb8SNiels Sascha Reedijknamespace BPrivate { 27ec865cb8SNiels Sascha Reedijk 28ec865cb8SNiels Sascha Reedijknamespace Network { 29ec865cb8SNiels Sascha Reedijk 30ec865cb8SNiels Sascha Reedijk 31ec865cb8SNiels Sascha Reedijk/*! 32ec865cb8SNiels Sascha Reedijk \class BHttpMethod 33ec865cb8SNiels Sascha Reedijk \ingroup netservices 34ec865cb8SNiels Sascha Reedijk \brief Represent a HTTP method. 35ec865cb8SNiels Sascha Reedijk 36ec865cb8SNiels Sascha Reedijk The <a href="https://datatracker.ietf.org/doc/html/rfc7231#section-4.1">HTTP standard</a> 37ec865cb8SNiels Sascha Reedijk specifies that HTTP requests have a method. Common methods are \c GET and \c HEAD methods. 38ec865cb8SNiels Sascha Reedijk Standardized and common methods are in the form of \em verbs and are in capitalized letters 39ec865cb8SNiels Sascha Reedijk from the ASCII token set, though any valid token can be used. 40ec865cb8SNiels Sascha Reedijk 41ec865cb8SNiels Sascha Reedijk It is most likely that you will not use the methods of this class directly, instead you will 42ec865cb8SNiels Sascha Reedijk use the implicit constructors while interacting with the \ref BHttpRequest class. 43ec865cb8SNiels Sascha Reedijk 44ec865cb8SNiels Sascha Reedijk \code 4559c359e5SNiels Sascha Reedijk auto url = BUrl("https://www.haiku-os.org/"); 46ec865cb8SNiels Sascha Reedijk // implicitly construct a standard get request 47ec865cb8SNiels Sascha Reedijk auto standard = BHttpRequest(url, BHttpMethod::Get); 48ec865cb8SNiels Sascha Reedijk // implicitly construct a nonstandard patch request 49ec865cb8SNiels Sascha Reedijk auto custom = BHttpRequest(url, "PATCH"sv); 50ec865cb8SNiels Sascha Reedijk \endcode 51ec865cb8SNiels Sascha Reedijk 52ec865cb8SNiels Sascha Reedijk \note When you are using the standard list of verbs, there will never be an exception when 53ec865cb8SNiels Sascha Reedijk creating objects of this type. When you create a custom method, exceptions may be raised 54ec865cb8SNiels Sascha Reedijk when the system runs out of memory, or when your custom method contains invalid characters. 55ec865cb8SNiels Sascha Reedijk In almost all cases, you can probably safely assume you will not run into these exceptions, 56ec865cb8SNiels Sascha Reedijk except for cases where you use user input to create methods or you are very defensive 57ec865cb8SNiels Sascha Reedijk about memory management. 58ec865cb8SNiels Sascha Reedijk 59ec865cb8SNiels Sascha Reedijk \since Haiku R1 60ec865cb8SNiels Sascha Reedijk*/ 61ec865cb8SNiels Sascha Reedijk 62ec865cb8SNiels Sascha Reedijk 63ec865cb8SNiels Sascha Reedijk/*! 64ec865cb8SNiels Sascha Reedijk \class BHttpMethod::InvalidMethod 65ec865cb8SNiels Sascha Reedijk \ingroup netservices 66ec865cb8SNiels Sascha Reedijk \brief Error that represents when a custom method does not conform to the HTTP standard. 67ec865cb8SNiels Sascha Reedijk 68ec865cb8SNiels Sascha Reedijk \since Haiku R1 69ec865cb8SNiels Sascha Reedijk*/ 70ec865cb8SNiels Sascha Reedijk 71ec865cb8SNiels Sascha Reedijk 72ec865cb8SNiels Sascha Reedijk/*! 73ec865cb8SNiels Sascha Reedijk \var BString BHttpMethod::InvalidMethod::input 74ec865cb8SNiels Sascha Reedijk \brief The input that contains the invalid contents. 75ec865cb8SNiels Sascha Reedijk 76ec865cb8SNiels Sascha Reedijk \since Haiku R1 77ec865cb8SNiels Sascha Reedijk*/ 78ec865cb8SNiels Sascha Reedijk 79ec865cb8SNiels Sascha Reedijk 80ec865cb8SNiels Sascha Reedijk/*! 81ec865cb8SNiels Sascha Reedijk \fn BHttpMethod::InvalidMethod::InvalidMethod(const char *origin, BString input) 82ec865cb8SNiels Sascha Reedijk \brief Constructor that sets the \a origin and the invalid \a input. 83ec865cb8SNiels Sascha Reedijk 84ec865cb8SNiels Sascha Reedijk \since Haiku R1 85ec865cb8SNiels Sascha Reedijk*/ 86ec865cb8SNiels Sascha Reedijk 87ec865cb8SNiels Sascha Reedijk 88ec865cb8SNiels Sascha Reedijk/*! 89ec865cb8SNiels Sascha Reedijk \enum BHttpMethod::Verb 90ec865cb8SNiels Sascha Reedijk \ingroup netservices 91ec865cb8SNiels Sascha Reedijk \brief A list of standard HTTP methods. 92ec865cb8SNiels Sascha Reedijk 93ec865cb8SNiels Sascha Reedijk \since Haiku R1 94ec865cb8SNiels Sascha Reedijk*/ 95ec865cb8SNiels Sascha Reedijk 96ec865cb8SNiels Sascha Reedijk 97ec865cb8SNiels Sascha Reedijk/*! 98ec865cb8SNiels Sascha Reedijk \var BHttpMethod::Verb BHttpMethod::Get 99ec865cb8SNiels Sascha Reedijk \brief Represents the \c GET method. 100ec865cb8SNiels Sascha Reedijk 101ec865cb8SNiels Sascha Reedijk \since Haiku R1 102ec865cb8SNiels Sascha Reedijk*/ 103ec865cb8SNiels Sascha Reedijk 104ec865cb8SNiels Sascha Reedijk 105ec865cb8SNiels Sascha Reedijk/*! 106ec865cb8SNiels Sascha Reedijk \var BHttpMethod::Verb BHttpMethod::Head 107ec865cb8SNiels Sascha Reedijk \brief Represents the \c HEAD method. 108ec865cb8SNiels Sascha Reedijk 109ec865cb8SNiels Sascha Reedijk \since Haiku R1 110ec865cb8SNiels Sascha Reedijk*/ 111ec865cb8SNiels Sascha Reedijk 112ec865cb8SNiels Sascha Reedijk 113ec865cb8SNiels Sascha Reedijk/*! 114ec865cb8SNiels Sascha Reedijk \var BHttpMethod::Verb BHttpMethod::Post 115ec865cb8SNiels Sascha Reedijk \brief Represents the \c POST method. 116ec865cb8SNiels Sascha Reedijk 117ec865cb8SNiels Sascha Reedijk \since Haiku R1 118ec865cb8SNiels Sascha Reedijk*/ 119ec865cb8SNiels Sascha Reedijk 120ec865cb8SNiels Sascha Reedijk 121ec865cb8SNiels Sascha Reedijk/*! 122ec865cb8SNiels Sascha Reedijk \var BHttpMethod::Verb BHttpMethod::Put 123ec865cb8SNiels Sascha Reedijk \brief Represents the \c PUT method. 124ec865cb8SNiels Sascha Reedijk 125ec865cb8SNiels Sascha Reedijk \since Haiku R1 126ec865cb8SNiels Sascha Reedijk*/ 127ec865cb8SNiels Sascha Reedijk 128ec865cb8SNiels Sascha Reedijk 129ec865cb8SNiels Sascha Reedijk/*! 130ec865cb8SNiels Sascha Reedijk \var BHttpMethod::Verb BHttpMethod::Delete 131ec865cb8SNiels Sascha Reedijk \brief Represents the \c DELETE method. 132ec865cb8SNiels Sascha Reedijk 133ec865cb8SNiels Sascha Reedijk \since Haiku R1 134ec865cb8SNiels Sascha Reedijk*/ 135ec865cb8SNiels Sascha Reedijk 136ec865cb8SNiels Sascha Reedijk 137ec865cb8SNiels Sascha Reedijk/*! 138ec865cb8SNiels Sascha Reedijk \var BHttpMethod::Verb BHttpMethod::Connect 139ec865cb8SNiels Sascha Reedijk \brief Represents the \c CONNECT method. 140ec865cb8SNiels Sascha Reedijk 141ec865cb8SNiels Sascha Reedijk \since Haiku R1 142ec865cb8SNiels Sascha Reedijk*/ 143ec865cb8SNiels Sascha Reedijk 144ec865cb8SNiels Sascha Reedijk 145ec865cb8SNiels Sascha Reedijk/*! 146ec865cb8SNiels Sascha Reedijk \var BHttpMethod::Verb BHttpMethod::Options 147ec865cb8SNiels Sascha Reedijk \brief Represents the \c OPTIONS method. 148ec865cb8SNiels Sascha Reedijk 149ec865cb8SNiels Sascha Reedijk \since Haiku R1 150ec865cb8SNiels Sascha Reedijk*/ 151ec865cb8SNiels Sascha Reedijk 152ec865cb8SNiels Sascha Reedijk 153ec865cb8SNiels Sascha Reedijk/*! 154ec865cb8SNiels Sascha Reedijk \var BHttpMethod::Verb BHttpMethod::Trace 155ec865cb8SNiels Sascha Reedijk \brief Represents the \c TRACE method. 156ec865cb8SNiels Sascha Reedijk 157ec865cb8SNiels Sascha Reedijk \since Haiku R1 158ec865cb8SNiels Sascha Reedijk*/ 159ec865cb8SNiels Sascha Reedijk 160ec865cb8SNiels Sascha Reedijk 161ec865cb8SNiels Sascha Reedijk/*! 162ec865cb8SNiels Sascha Reedijk \fn BHttpMethod::BHttpMethod(BHttpMethod &&other) noexcept 163ec865cb8SNiels Sascha Reedijk \brief Move constructor. 164ec865cb8SNiels Sascha Reedijk 165ec865cb8SNiels Sascha Reedijk Moves the data from the \a other to this object. The \a other object will be set to 166ec865cb8SNiels Sascha Reedijk \ref BHttpMethod::Get. 167ec865cb8SNiels Sascha Reedijk 168ec865cb8SNiels Sascha Reedijk \since Haiku R1 169ec865cb8SNiels Sascha Reedijk*/ 170ec865cb8SNiels Sascha Reedijk 171ec865cb8SNiels Sascha Reedijk 172ec865cb8SNiels Sascha Reedijk/*! 173ec865cb8SNiels Sascha Reedijk \fn BHttpMethod::BHttpMethod(const BHttpMethod &other) 174ec865cb8SNiels Sascha Reedijk \brief Copy constructor. 175ec865cb8SNiels Sascha Reedijk 176ec865cb8SNiels Sascha Reedijk Copy data from an \a other object. 177ec865cb8SNiels Sascha Reedijk 178ec865cb8SNiels Sascha Reedijk \exception std::bad_alloc When the \a other object contains a custom verb, this exception 179ec865cb8SNiels Sascha Reedijk will be raised if it is impossible to allocate memory. 180ec865cb8SNiels Sascha Reedijk 181ec865cb8SNiels Sascha Reedijk \since Haiku R1 182ec865cb8SNiels Sascha Reedijk*/ 183ec865cb8SNiels Sascha Reedijk 184ec865cb8SNiels Sascha Reedijk 185ec865cb8SNiels Sascha Reedijk/*! 186ec865cb8SNiels Sascha Reedijk \fn BHttpMethod::BHttpMethod(const std::string_view &method) 187ec865cb8SNiels Sascha Reedijk \brief Construct a custom method. 188ec865cb8SNiels Sascha Reedijk 189ec865cb8SNiels Sascha Reedijk \param method The verb for the method. 190ec865cb8SNiels Sascha Reedijk 191ec865cb8SNiels Sascha Reedijk \exception std::bad_alloc In case it is not possible to allocate memory for the custom string. 192ec865cb8SNiels Sascha Reedijk \exception BHttpMethod::InvalidMethod In case the \a method is empty or contains invalid 193ec865cb8SNiels Sascha Reedijk characters. 194ec865cb8SNiels Sascha Reedijk 195ec865cb8SNiels Sascha Reedijk \since Haiku R1 196ec865cb8SNiels Sascha Reedijk*/ 197ec865cb8SNiels Sascha Reedijk 198ec865cb8SNiels Sascha Reedijk 199ec865cb8SNiels Sascha Reedijk/*! 200ec865cb8SNiels Sascha Reedijk \fn BHttpMethod::BHttpMethod(Verb verb) noexcept 201ec865cb8SNiels Sascha Reedijk \brief Construct a standard method. 202ec865cb8SNiels Sascha Reedijk 203ec865cb8SNiels Sascha Reedijk \param verb The chosen method. 204ec865cb8SNiels Sascha Reedijk 205ec865cb8SNiels Sascha Reedijk \since Haiku R1 206ec865cb8SNiels Sascha Reedijk*/ 207ec865cb8SNiels Sascha Reedijk 208ec865cb8SNiels Sascha Reedijk 209ec865cb8SNiels Sascha Reedijk/*! 210ec865cb8SNiels Sascha Reedijk \fn BHttpMethod::~BHttpMethod() 211ec865cb8SNiels Sascha Reedijk \brief Destructor. 212ec865cb8SNiels Sascha Reedijk 213ec865cb8SNiels Sascha Reedijk \since Haiku R1 214ec865cb8SNiels Sascha Reedijk*/ 215ec865cb8SNiels Sascha Reedijk 216ec865cb8SNiels Sascha Reedijk 217ec865cb8SNiels Sascha Reedijk/*! 21859c359e5SNiels Sascha Reedijk \fn bool BHttpMethod::operator==(const Verb &other) const noexcept 21959c359e5SNiels Sascha Reedijk \brief Comparison operator. 22059c359e5SNiels Sascha Reedijk 22159c359e5SNiels Sascha Reedijk \param other The verb to compare to. 22259c359e5SNiels Sascha Reedijk 22359c359e5SNiels Sascha Reedijk \retval true This method is equal to \a other. 22459c359e5SNiels Sascha Reedijk \retval false This method is different from \a other. 22559c359e5SNiels Sascha Reedijk 22659c359e5SNiels Sascha Reedijk \since Haiku R1 22759c359e5SNiels Sascha Reedijk*/ 22859c359e5SNiels Sascha Reedijk 22959c359e5SNiels Sascha Reedijk 23059c359e5SNiels Sascha Reedijk/*! 23113bfff7bSNiels Sascha Reedijk \fn bool BHttpMethod::operator!=(const Verb &other) const noexcept 23213bfff7bSNiels Sascha Reedijk \brief Comparison operator. 23313bfff7bSNiels Sascha Reedijk 23413bfff7bSNiels Sascha Reedijk \param other The verb to compare to. 23513bfff7bSNiels Sascha Reedijk 23613bfff7bSNiels Sascha Reedijk \retval true This method is different from \a other. 23713bfff7bSNiels Sascha Reedijk \retval false This method is equal to \a other. 23813bfff7bSNiels Sascha Reedijk 23913bfff7bSNiels Sascha Reedijk \since Haiku R1 24013bfff7bSNiels Sascha Reedijk*/ 24113bfff7bSNiels Sascha Reedijk 24213bfff7bSNiels Sascha Reedijk 24313bfff7bSNiels Sascha Reedijk/*! 244ec865cb8SNiels Sascha Reedijk \fn const std::string_view BHttpMethod::Method() const noexcept 245ec865cb8SNiels Sascha Reedijk \brief Get a string representation of the method. 246ec865cb8SNiels Sascha Reedijk 247ec865cb8SNiels Sascha Reedijk \return A \c std::string_view that is a string representation of the standard or custom method 248ec865cb8SNiels Sascha Reedijk in this object. The lifetime of the string view is bound to the lifetime of this method. 249ec865cb8SNiels Sascha Reedijk 250ec865cb8SNiels Sascha Reedijk \since Haiku R1 251ec865cb8SNiels Sascha Reedijk*/ 252ec865cb8SNiels Sascha Reedijk 253ec865cb8SNiels Sascha Reedijk 254ec865cb8SNiels Sascha Reedijk/*! 255ec865cb8SNiels Sascha Reedijk \fn BHttpMethod& BHttpMethod::operator=(BHttpMethod &&other) noexcept 256ec865cb8SNiels Sascha Reedijk \brief Move assignment. 257ec865cb8SNiels Sascha Reedijk Moves the data from the \a other to this object. The \a other object will be set to 258ec865cb8SNiels Sascha Reedijk \ref BHttpMethod::Get. 259ec865cb8SNiels Sascha Reedijk 260ec865cb8SNiels Sascha Reedijk \since Haiku R1 261ec865cb8SNiels Sascha Reedijk*/ 262ec865cb8SNiels Sascha Reedijk 263ec865cb8SNiels Sascha Reedijk 264ec865cb8SNiels Sascha Reedijk/*! 26513bfff7bSNiels Sascha Reedijk \fn BHttpMethod& BHttpMethod::operator=(const BHttpMethod &other) 266ec865cb8SNiels Sascha Reedijk \brief Copy assignment. 267ec865cb8SNiels Sascha Reedijk 268ec865cb8SNiels Sascha Reedijk Copy data from an \a other object. 269ec865cb8SNiels Sascha Reedijk 270ec865cb8SNiels Sascha Reedijk \exception std::bad_alloc When the \a other object contains a custom verb, this exception 271ec865cb8SNiels Sascha Reedijk will be raised if it is impossible to allocate memory. 272ec865cb8SNiels Sascha Reedijk 273ec865cb8SNiels Sascha Reedijk \since Haiku R1 274ec865cb8SNiels Sascha Reedijk*/ 275ec865cb8SNiels Sascha Reedijk 276ec865cb8SNiels Sascha Reedijk 2776ce6e964SNiels Sascha Reedijk/*! 27813bfff7bSNiels Sascha Reedijk \struct BHttpRedirectOptions 27913bfff7bSNiels Sascha Reedijk \ingroup netservices 28013bfff7bSNiels Sascha Reedijk \brief Describe redirection options for a \ref BHttpRequest. 28113bfff7bSNiels Sascha Reedijk 28213bfff7bSNiels Sascha Reedijk \see These options are used by \ref BHttpRequest::Redirect() and 28313bfff7bSNiels Sascha Reedijk \ref BHttpRequest::SetRedirect() 28413bfff7bSNiels Sascha Reedijk 28513bfff7bSNiels Sascha Reedijk \since Haiku R1 28613bfff7bSNiels Sascha Reedijk*/ 28713bfff7bSNiels Sascha Reedijk 28813bfff7bSNiels Sascha Reedijk 28913bfff7bSNiels Sascha Reedijk/*! 29013bfff7bSNiels Sascha Reedijk \var bool BHttpRedirectOptions::followRedirect 29113bfff7bSNiels Sascha Reedijk \brief Describe whether the request should follow redirects. 29213bfff7bSNiels Sascha Reedijk 29313bfff7bSNiels Sascha Reedijk \see These options are used by \ref BHttpRequest::Redirect() and 29413bfff7bSNiels Sascha Reedijk \ref BHttpRequest::SetRedirect() 29513bfff7bSNiels Sascha Reedijk 29613bfff7bSNiels Sascha Reedijk \since Haiku R1 29713bfff7bSNiels Sascha Reedijk*/ 29813bfff7bSNiels Sascha Reedijk 29913bfff7bSNiels Sascha Reedijk 30013bfff7bSNiels Sascha Reedijk/*! 30113bfff7bSNiels Sascha Reedijk \var uint8 BHttpRedirectOptions::maxRedirections 30213bfff7bSNiels Sascha Reedijk \brief The maximum number of redirects that should be followed. 30313bfff7bSNiels Sascha Reedijk 30413bfff7bSNiels Sascha Reedijk \see These options are used by \ref BHttpRequest::Redirect() and 30513bfff7bSNiels Sascha Reedijk \ref BHttpRequest::SetRedirect() 30613bfff7bSNiels Sascha Reedijk 30713bfff7bSNiels Sascha Reedijk \since Haiku R1 30813bfff7bSNiels Sascha Reedijk*/ 30913bfff7bSNiels Sascha Reedijk 31013bfff7bSNiels Sascha Reedijk 31113bfff7bSNiels Sascha Reedijk/*! 312*f9d9d202SNiels Sascha Reedijk \struct BHttpAuthentication 313*f9d9d202SNiels Sascha Reedijk \ingroup netservices 314*f9d9d202SNiels Sascha Reedijk \brief Describe username and password for basic authentication for the request. 315*f9d9d202SNiels Sascha Reedijk 316*f9d9d202SNiels Sascha Reedijk \see These options are used by \ref BHttpRequest::Authentication() and 317*f9d9d202SNiels Sascha Reedijk \ref BHttpRequest::SetAuthentication() 318*f9d9d202SNiels Sascha Reedijk 319*f9d9d202SNiels Sascha Reedijk \since Haiku R1 320*f9d9d202SNiels Sascha Reedijk*/ 321*f9d9d202SNiels Sascha Reedijk 322*f9d9d202SNiels Sascha Reedijk 323*f9d9d202SNiels Sascha Reedijk/*! 324*f9d9d202SNiels Sascha Reedijk \var BString BHttpAuthentication::username 325*f9d9d202SNiels Sascha Reedijk \brief The username for the request. 326*f9d9d202SNiels Sascha Reedijk 327*f9d9d202SNiels Sascha Reedijk \since Haiku R1 328*f9d9d202SNiels Sascha Reedijk*/ 329*f9d9d202SNiels Sascha Reedijk 330*f9d9d202SNiels Sascha Reedijk 331*f9d9d202SNiels Sascha Reedijk/*! 332*f9d9d202SNiels Sascha Reedijk \var BString BHttpAuthentication::password 333*f9d9d202SNiels Sascha Reedijk \brief The password for the request. 334*f9d9d202SNiels Sascha Reedijk 335*f9d9d202SNiels Sascha Reedijk \since Haiku R1 336*f9d9d202SNiels Sascha Reedijk*/ 337*f9d9d202SNiels Sascha Reedijk 338*f9d9d202SNiels Sascha Reedijk 339*f9d9d202SNiels Sascha Reedijk/*! 3406ce6e964SNiels Sascha Reedijk \class BHttpRequest 3416ce6e964SNiels Sascha Reedijk \ingroup netservices 3426ce6e964SNiels Sascha Reedijk \brief Represent a HTTP request. 3436ce6e964SNiels Sascha Reedijk 3446ce6e964SNiels Sascha Reedijk This class can be used to construct HTTP requests that can be executed by the Network Services 3456ce6e964SNiels Sascha Reedijk Kit. A request has two states, either it is is a valid request, or it is an empty request. The 3466ce6e964SNiels Sascha Reedijk criterium is whether or not the request has a URL. 3476ce6e964SNiels Sascha Reedijk 3486ce6e964SNiels Sascha Reedijk This class has all kinds of convenience methods set and retrieve particular options. Most 3496ce6e964SNiels Sascha Reedijk options are wrapped in specialized container classes that do some form of validation. 3506ce6e964SNiels Sascha Reedijk 3516ce6e964SNiels Sascha Reedijk The default options are: 3526ce6e964SNiels Sascha Reedijk <table> 3536ce6e964SNiels Sascha Reedijk <tr><th>Getter</th><th>Setter</th><th>Description</th><th>Default</th></tr> 3546ce6e964SNiels Sascha Reedijk <tr> 3556ce6e964SNiels Sascha Reedijk <td> \ref Url() </td> 3566ce6e964SNiels Sascha Reedijk <td> \ref SetUrl() </td> 3576ce6e964SNiels Sascha Reedijk <td> The URL. This must start with http or https. </td> 3586ce6e964SNiels Sascha Reedijk <td> Defaults to an empty \ref BUrl </td> 3596ce6e964SNiels Sascha Reedijk </tr> 3606ce6e964SNiels Sascha Reedijk <tr> 361f7515342SNiels Sascha Reedijk <td> \ref Fields() </td> 362f7515342SNiels Sascha Reedijk <td> \ref SetFields() </td> 363f7515342SNiels Sascha Reedijk <td> Additional fields set in the request header. </td> 364f7515342SNiels Sascha Reedijk <td> Defaults with no additional fields </td> 365f7515342SNiels Sascha Reedijk </tr> 366f7515342SNiels Sascha Reedijk <tr> 3676ce6e964SNiels Sascha Reedijk <td> \ref Method() </td> 3686ce6e964SNiels Sascha Reedijk <td> \ref SetMethod() </td> 3696ce6e964SNiels Sascha Reedijk <td> The HTTP method for the request </td> 3706ce6e964SNiels Sascha Reedijk <td> Defaults to \ref BHttpMethod::Get </td> 3716ce6e964SNiels Sascha Reedijk </tr> 37213bfff7bSNiels Sascha Reedijk <tr> 37313bfff7bSNiels Sascha Reedijk <td> \ref Redirect() </td> 37413bfff7bSNiels Sascha Reedijk <td> \ref SetRedirect() </td> 37513bfff7bSNiels Sascha Reedijk <td> Whether redirects should be followed, and if so, how many </td> 37613bfff7bSNiels Sascha Reedijk <td> By default redirects are followed, up to 8 redirects for one request </td> 37713bfff7bSNiels Sascha Reedijk </tr> 3786ce6e964SNiels Sascha Reedijk </table> 3796ce6e964SNiels Sascha Reedijk 3806ce6e964SNiels Sascha Reedijk \since Haiku R1 3816ce6e964SNiels Sascha Reedijk*/ 3826ce6e964SNiels Sascha Reedijk 3836ce6e964SNiels Sascha Reedijk 3846ce6e964SNiels Sascha Reedijk/*! 3856ce6e964SNiels Sascha Reedijk \name Constructors and Destructor 3866ce6e964SNiels Sascha Reedijk*/ 3876ce6e964SNiels Sascha Reedijk 3886ce6e964SNiels Sascha Reedijk 3896ce6e964SNiels Sascha Reedijk//! @{ 3906ce6e964SNiels Sascha Reedijk 3916ce6e964SNiels Sascha Reedijk 3926ce6e964SNiels Sascha Reedijk/*! 3936ce6e964SNiels Sascha Reedijk \fn BHttpRequest::BHttpRequest() 3946ce6e964SNiels Sascha Reedijk \brief Construct an empty HTTP request. 3956ce6e964SNiels Sascha Reedijk 3966ce6e964SNiels Sascha Reedijk \exception std::bad_alloc This exception may be raised if it is impossible to allocate memory. 3976ce6e964SNiels Sascha Reedijk 3986ce6e964SNiels Sascha Reedijk \since Haiku R1 3996ce6e964SNiels Sascha Reedijk*/ 4006ce6e964SNiels Sascha Reedijk 4016ce6e964SNiels Sascha Reedijk 4026ce6e964SNiels Sascha Reedijk/*! 4036ce6e964SNiels Sascha Reedijk \fn BHttpRequest::BHttpRequest(const BUrl &url) 4046ce6e964SNiels Sascha Reedijk \brief Construct a HTTP request for an \a url. 4056ce6e964SNiels Sascha Reedijk 4066ce6e964SNiels Sascha Reedijk \param url A valid URL with the \c http or \c https protocol. 4076ce6e964SNiels Sascha Reedijk 4086ce6e964SNiels Sascha Reedijk \exception std::bad_alloc This exception may be raised if it is impossible to allocate memory. 4096ce6e964SNiels Sascha Reedijk \exception BUnsupportedProtocol This exception is raised when the protocol of the URL cannot be 4106ce6e964SNiels Sascha Reedijk handled. 4116ce6e964SNiels Sascha Reedijk \exception BInvalidUrl This exception is raised when the \a url is invalid. 4126ce6e964SNiels Sascha Reedijk 4136ce6e964SNiels Sascha Reedijk \since Haiku R1 4146ce6e964SNiels Sascha Reedijk*/ 4156ce6e964SNiels Sascha Reedijk 4166ce6e964SNiels Sascha Reedijk 4176ce6e964SNiels Sascha Reedijk/*! 4186ce6e964SNiels Sascha Reedijk \fn BHttpRequest::BHttpRequest(const BHttpRequest &other)=delete 4196ce6e964SNiels Sascha Reedijk \brief Copying is not allowed. 4206ce6e964SNiels Sascha Reedijk 4216ce6e964SNiels Sascha Reedijk \since Haiku R1 4226ce6e964SNiels Sascha Reedijk*/ 4236ce6e964SNiels Sascha Reedijk 4246ce6e964SNiels Sascha Reedijk 4256ce6e964SNiels Sascha Reedijk/*! 4266ce6e964SNiels Sascha Reedijk \fn BHttpRequest::BHttpRequest(BHttpRequest &&other) noexcept 4276ce6e964SNiels Sascha Reedijk \brief Move constructor. 4286ce6e964SNiels Sascha Reedijk 4296ce6e964SNiels Sascha Reedijk After a move, the \a other object is left in an empty state. 4306ce6e964SNiels Sascha Reedijk 4316ce6e964SNiels Sascha Reedijk \param other The request to move data from. 4326ce6e964SNiels Sascha Reedijk 4336ce6e964SNiels Sascha Reedijk \since Haiku R1 4346ce6e964SNiels Sascha Reedijk*/ 4356ce6e964SNiels Sascha Reedijk 4366ce6e964SNiels Sascha Reedijk 4376ce6e964SNiels Sascha Reedijk/*! 4386ce6e964SNiels Sascha Reedijk \fn BPrivate::Network::BHttpRequest::~BHttpRequest() 4396ce6e964SNiels Sascha Reedijk \brief Destructor 4406ce6e964SNiels Sascha Reedijk 4416ce6e964SNiels Sascha Reedijk \since Haiku R1 4426ce6e964SNiels Sascha Reedijk*/ 4436ce6e964SNiels Sascha Reedijk 4446ce6e964SNiels Sascha Reedijk 4456ce6e964SNiels Sascha Reedijk//! @} 4466ce6e964SNiels Sascha Reedijk 4476ce6e964SNiels Sascha Reedijk 4486ce6e964SNiels Sascha Reedijk/*! 4496ce6e964SNiels Sascha Reedijk \name Assignment operators 4506ce6e964SNiels Sascha Reedijk*/ 4516ce6e964SNiels Sascha Reedijk 4526ce6e964SNiels Sascha Reedijk 4536ce6e964SNiels Sascha Reedijk//! @{ 4546ce6e964SNiels Sascha Reedijk 4556ce6e964SNiels Sascha Reedijk 4566ce6e964SNiels Sascha Reedijk/*! 4576ce6e964SNiels Sascha Reedijk \fn BHttpRequest& BHttpRequest::operator=(const BHttpRequest &other)=delete 4586ce6e964SNiels Sascha Reedijk \brief Copy assignment is not allowed. 4596ce6e964SNiels Sascha Reedijk 4606ce6e964SNiels Sascha Reedijk \since Haiku R1 4616ce6e964SNiels Sascha Reedijk*/ 4626ce6e964SNiels Sascha Reedijk 4636ce6e964SNiels Sascha Reedijk 4646ce6e964SNiels Sascha Reedijk/*! 4656ce6e964SNiels Sascha Reedijk \fn BHttpRequest& BHttpRequest::operator=(BHttpRequest &&other) noexcept 4666ce6e964SNiels Sascha Reedijk \brief Move assignment 4676ce6e964SNiels Sascha Reedijk 4686ce6e964SNiels Sascha Reedijk After a move, the \a other object is left in an empty state. 4696ce6e964SNiels Sascha Reedijk 4706ce6e964SNiels Sascha Reedijk \param other The request to move data from. 4716ce6e964SNiels Sascha Reedijk 4726ce6e964SNiels Sascha Reedijk \since Haiku R1 4736ce6e964SNiels Sascha Reedijk*/ 4746ce6e964SNiels Sascha Reedijk 4756ce6e964SNiels Sascha Reedijk 4766ce6e964SNiels Sascha Reedijk//! @} 4776ce6e964SNiels Sascha Reedijk 4786ce6e964SNiels Sascha Reedijk 4796ce6e964SNiels Sascha Reedijk/*! 4806ce6e964SNiels Sascha Reedijk \name Valid or empty 4816ce6e964SNiels Sascha Reedijk*/ 4826ce6e964SNiels Sascha Reedijk 4836ce6e964SNiels Sascha Reedijk 4846ce6e964SNiels Sascha Reedijk//! @{ 4856ce6e964SNiels Sascha Reedijk 4866ce6e964SNiels Sascha Reedijk 4876ce6e964SNiels Sascha Reedijk/*! 4886ce6e964SNiels Sascha Reedijk \fn bool BHttpRequest::IsEmpty() const noexcept 4896ce6e964SNiels Sascha Reedijk \brief Check if the request is valid or empty 4906ce6e964SNiels Sascha Reedijk 4916ce6e964SNiels Sascha Reedijk \retval true The request is empty. 4926ce6e964SNiels Sascha Reedijk \retval false The request is valid. 4936ce6e964SNiels Sascha Reedijk 4946ce6e964SNiels Sascha Reedijk \since Haiku R1 4956ce6e964SNiels Sascha Reedijk*/ 4966ce6e964SNiels Sascha Reedijk 4976ce6e964SNiels Sascha Reedijk 4986ce6e964SNiels Sascha Reedijk//! @} 4996ce6e964SNiels Sascha Reedijk 5006ce6e964SNiels Sascha Reedijk 5016ce6e964SNiels Sascha Reedijk/*! 5026ce6e964SNiels Sascha Reedijk \name Current Options 5036ce6e964SNiels Sascha Reedijk*/ 5046ce6e964SNiels Sascha Reedijk 5056ce6e964SNiels Sascha Reedijk 5066ce6e964SNiels Sascha Reedijk//! @{ 5076ce6e964SNiels Sascha Reedijk 5086ce6e964SNiels Sascha Reedijk 5096ce6e964SNiels Sascha Reedijk/*! 510*f9d9d202SNiels Sascha Reedijk \fn const BHttpAuthentication* BHttpRequest::Authentication() const noexcept 511*f9d9d202SNiels Sascha Reedijk \brief Get the credentials for the authentication for the request. 512*f9d9d202SNiels Sascha Reedijk 513*f9d9d202SNiels Sascha Reedijk \return When no credentials are set for this request, the method returns a \c nullptr. 514*f9d9d202SNiels Sascha Reedijk Otherwise, it will return a pointer to the current BHttpAuthentication data set for this 515*f9d9d202SNiels Sascha Reedijk request. 516*f9d9d202SNiels Sascha Reedijk 517*f9d9d202SNiels Sascha Reedijk \since Haiku R1 518*f9d9d202SNiels Sascha Reedijk*/ 519*f9d9d202SNiels Sascha Reedijk 520*f9d9d202SNiels Sascha Reedijk 521*f9d9d202SNiels Sascha Reedijk/*! 522f7515342SNiels Sascha Reedijk \fn const BHttpFields& BHttpRequest::Fields() const noexcept 523f7515342SNiels Sascha Reedijk \brief Get the additional header fields set for the request. 524f7515342SNiels Sascha Reedijk 525f7515342SNiels Sascha Reedijk The returned header fields may be empty if no additional header fields were set. 526f7515342SNiels Sascha Reedijk 527f7515342SNiels Sascha Reedijk \since Haiku R1 528f7515342SNiels Sascha Reedijk*/ 529f7515342SNiels Sascha Reedijk 530f7515342SNiels Sascha Reedijk 531f7515342SNiels Sascha Reedijk/*! 5326ce6e964SNiels Sascha Reedijk \fn const BHttpMethod& BHttpRequest::Method() const noexcept 5336ce6e964SNiels Sascha Reedijk \brief Get the current method for the request. 5346ce6e964SNiels Sascha Reedijk 5356ce6e964SNiels Sascha Reedijk This will either return the custom value set for this request, or the default as is listed in 5366ce6e964SNiels Sascha Reedijk the overview documentation of this class. 5376ce6e964SNiels Sascha Reedijk 5386ce6e964SNiels Sascha Reedijk \since Haiku R1 5396ce6e964SNiels Sascha Reedijk*/ 5406ce6e964SNiels Sascha Reedijk 5416ce6e964SNiels Sascha Reedijk 5426ce6e964SNiels Sascha Reedijk/*! 54313bfff7bSNiels Sascha Reedijk \fn const BHttpRedirectOptions& BHttpRequest::Redirect() const noexcept 54413bfff7bSNiels Sascha Reedijk \brief Get the current redirection options for this request. 54513bfff7bSNiels Sascha Reedijk 54613bfff7bSNiels Sascha Reedijk \see \ref BHttpRequest::SetRedirect() for details on the options. 54713bfff7bSNiels Sascha Reedijk 54813bfff7bSNiels Sascha Reedijk \since Haiku R1 54913bfff7bSNiels Sascha Reedijk*/ 55013bfff7bSNiels Sascha Reedijk 55113bfff7bSNiels Sascha Reedijk 55213bfff7bSNiels Sascha Reedijk/*! 5536ce6e964SNiels Sascha Reedijk \fn const BUrl& BHttpRequest::Url() const noexcept 5546ce6e964SNiels Sascha Reedijk \brief Get the current Url for the request. 5556ce6e964SNiels Sascha Reedijk 5566ce6e964SNiels Sascha Reedijk This will either return the custom value set for this request, or the default as is listed in 5576ce6e964SNiels Sascha Reedijk the overview documentation of this class. 5586ce6e964SNiels Sascha Reedijk 5596ce6e964SNiels Sascha Reedijk \since Haiku R1 5606ce6e964SNiels Sascha Reedijk*/ 5616ce6e964SNiels Sascha Reedijk 5626ce6e964SNiels Sascha Reedijk 5636ce6e964SNiels Sascha Reedijk//! @} 5646ce6e964SNiels Sascha Reedijk 5656ce6e964SNiels Sascha Reedijk 5666ce6e964SNiels Sascha Reedijk/*! 5676ce6e964SNiels Sascha Reedijk \name Setting Options 5686ce6e964SNiels Sascha Reedijk*/ 5696ce6e964SNiels Sascha Reedijk 5706ce6e964SNiels Sascha Reedijk 5716ce6e964SNiels Sascha Reedijk//! @{ 5726ce6e964SNiels Sascha Reedijk 5736ce6e964SNiels Sascha Reedijk 5746ce6e964SNiels Sascha Reedijk/*! 575*f9d9d202SNiels Sascha Reedijk \fn void BHttpRequest::SetAuthentication(const BHttpAuthentication &authentication) 576*f9d9d202SNiels Sascha Reedijk \brief Set the credentials to enable basic authentication for the request. 577*f9d9d202SNiels Sascha Reedijk 578*f9d9d202SNiels Sascha Reedijk The Basic authorization line is added to the request upon setting the request details. There is 579*f9d9d202SNiels Sascha Reedijk no support for other authentication schemes, like digest authentication. 580*f9d9d202SNiels Sascha Reedijk 581*f9d9d202SNiels Sascha Reedijk \param authentication The credentials to apply to the request. 582*f9d9d202SNiels Sascha Reedijk 583*f9d9d202SNiels Sascha Reedijk \exception std::bad_alloc This exception may be raised if it is impossible to allocate memory. 584*f9d9d202SNiels Sascha Reedijk 585*f9d9d202SNiels Sascha Reedijk \since Haiku R1 586*f9d9d202SNiels Sascha Reedijk*/ 587*f9d9d202SNiels Sascha Reedijk 588*f9d9d202SNiels Sascha Reedijk 589*f9d9d202SNiels Sascha Reedijk/*! 590f7515342SNiels Sascha Reedijk \fn void BHttpRequest::SetFields(const BHttpFields &fields) 591f7515342SNiels Sascha Reedijk \brief Set additional header \a fields for this request. 592f7515342SNiels Sascha Reedijk 593f7515342SNiels Sascha Reedijk There are a few reserved fields, which cannot be set as optional fields. These currently are: 594f7515342SNiels Sascha Reedijk * \c Host 595f7515342SNiels Sascha Reedijk * \c Accept 596f7515342SNiels Sascha Reedijk * \c Accept-Encoding 597f7515342SNiels Sascha Reedijk * \c Connection 598f7515342SNiels Sascha Reedijk 599f7515342SNiels Sascha Reedijk \param fields Additional fields for the header of the request. 600f7515342SNiels Sascha Reedijk 601f7515342SNiels Sascha Reedijk \exception std::bad_alloc This exception may be raised if it is impossible to allocate memory. 602f7515342SNiels Sascha Reedijk \exception BHttpFields::InvalidData This exception is raised when the \a fields contain 603f7515342SNiels Sascha Reedijk reserved fields. 604f7515342SNiels Sascha Reedijk 605f7515342SNiels Sascha Reedijk \since Haiku R1 606f7515342SNiels Sascha Reedijk*/ 607f7515342SNiels Sascha Reedijk 608f7515342SNiels Sascha Reedijk 609f7515342SNiels Sascha Reedijk/*! 6106ce6e964SNiels Sascha Reedijk \fn void BHttpRequest::SetMethod(const BHttpMethod &method) 6116ce6e964SNiels Sascha Reedijk \brief Set the \a method for this request. 6126ce6e964SNiels Sascha Reedijk 6136ce6e964SNiels Sascha Reedijk Note that there currently is no additional validation done on any semantical incompatibilities. 6146ce6e964SNiels Sascha Reedijk This means that it is currently allowed to do a \c GET or \c HEAD request with data, while that 6156ce6e964SNiels Sascha Reedijk is forbidden by the standard. 6166ce6e964SNiels Sascha Reedijk 6176ce6e964SNiels Sascha Reedijk \param method The method to use for the request. 6186ce6e964SNiels Sascha Reedijk 6196ce6e964SNiels Sascha Reedijk \exception std::bad_alloc This exception may be raised if it is impossible to allocate memory. 6206ce6e964SNiels Sascha Reedijk 6216ce6e964SNiels Sascha Reedijk \since Haiku R1 6226ce6e964SNiels Sascha Reedijk*/ 6236ce6e964SNiels Sascha Reedijk 6246ce6e964SNiels Sascha Reedijk 6256ce6e964SNiels Sascha Reedijk/*! 62613bfff7bSNiels Sascha Reedijk \fn void BHttpRequest::SetRedirect(const BHttpRedirectOptions &redirectOptions) 62713bfff7bSNiels Sascha Reedijk \brief Set the redirection options for this request. 62813bfff7bSNiels Sascha Reedijk 62913bfff7bSNiels Sascha Reedijk The HTTP protocol allows the server to redirect requests if the resources have moved to a new 63013bfff7bSNiels Sascha Reedijk location. For your convenience, you can instruct the network services kit to follow these 63113bfff7bSNiels Sascha Reedijk redirections. 63213bfff7bSNiels Sascha Reedijk 63313bfff7bSNiels Sascha Reedijk The \ref BHttpRedirectOptions allows you to set what the redirection policy should be. You can 63413bfff7bSNiels Sascha Reedijk set whether redirects should be followed at all, and if so, how many redirects should be 63513bfff7bSNiels Sascha Reedijk followed. The maximum value is that of an unsigned 8 bit int, so maximum is 256 redirects. This 63613bfff7bSNiels Sascha Reedijk prevents the request from staying stuck in a redirection loop. 63713bfff7bSNiels Sascha Reedijk 63813bfff7bSNiels Sascha Reedijk If redirects are disabled, or the maximum number of redirects have been processed, then the 63913bfff7bSNiels Sascha Reedijk response will be set to the actual (last) received redirection response. 64013bfff7bSNiels Sascha Reedijk 64113bfff7bSNiels Sascha Reedijk \param redirectOptions The options for redirections. 64213bfff7bSNiels Sascha Reedijk 64313bfff7bSNiels Sascha Reedijk \exception std::bad_alloc This exception may be raised if it is impossible to allocate memory. 64413bfff7bSNiels Sascha Reedijk 64513bfff7bSNiels Sascha Reedijk \since Haiku R1 64613bfff7bSNiels Sascha Reedijk*/ 64713bfff7bSNiels Sascha Reedijk 64813bfff7bSNiels Sascha Reedijk 64913bfff7bSNiels Sascha Reedijk/*! 6506ce6e964SNiels Sascha Reedijk \fn void BHttpRequest::SetUrl(const BUrl &url) 6516ce6e964SNiels Sascha Reedijk \brief Set the \a url for this request. 6526ce6e964SNiels Sascha Reedijk 6536ce6e964SNiels Sascha Reedijk \param url A valid URL with the \c http or \c https protocol. 6546ce6e964SNiels Sascha Reedijk 6556ce6e964SNiels Sascha Reedijk \exception std::bad_alloc This exception may be raised if it is impossible to allocate memory. 6566ce6e964SNiels Sascha Reedijk \exception BUnsupportedProtocol This exception is raised when the protocol of the URL cannot be 6576ce6e964SNiels Sascha Reedijk handled. 6586ce6e964SNiels Sascha Reedijk \exception BInvalidUrl This exception is raised when the \a url is invalid. 6596ce6e964SNiels Sascha Reedijk 6606ce6e964SNiels Sascha Reedijk \since Haiku R1 6616ce6e964SNiels Sascha Reedijk*/ 6626ce6e964SNiels Sascha Reedijk 6636ce6e964SNiels Sascha Reedijk 6646ce6e964SNiels Sascha Reedijk//! @} 6656ce6e964SNiels Sascha Reedijk 6666ce6e964SNiels Sascha Reedijk 667d9a4c607SNiels Sascha Reedijk/*! 668d9a4c607SNiels Sascha Reedijk \name Serialization 669d9a4c607SNiels Sascha Reedijk*/ 670d9a4c607SNiels Sascha Reedijk 671d9a4c607SNiels Sascha Reedijk 672d9a4c607SNiels Sascha Reedijk//! @{ 673d9a4c607SNiels Sascha Reedijk 674d9a4c607SNiels Sascha Reedijk 675d9a4c607SNiels Sascha Reedijk/*! 676d9a4c607SNiels Sascha Reedijk \fn ssize_t BHttpRequest::SerializeHeaderTo(BDataIO *target) const 677d9a4c607SNiels Sascha Reedijk \brief Serialize the HTTP Header of this request to the \a target. 678d9a4c607SNiels Sascha Reedijk 679d9a4c607SNiels Sascha Reedijk The HTTP header consists of the request line, and the fields, serialized as text according to 680d9a4c607SNiels Sascha Reedijk the HTTP specification. 681d9a4c607SNiels Sascha Reedijk 682d9a4c607SNiels Sascha Reedijk \param target The \ref BDataIO object to write the header to 683d9a4c607SNiels Sascha Reedijk 684d9a4c607SNiels Sascha Reedijk \return The total number of byte size of the header. 685d9a4c607SNiels Sascha Reedijk 686d9a4c607SNiels Sascha Reedijk \exception BSystemError In case there is an error when calling the \ref BDataIO::Write() call 687d9a4c607SNiels Sascha Reedijk of the provided \a target. Note that writing the string is \em not transactional, and that 688d9a4c607SNiels Sascha Reedijk the error can occur while a part of the header has already been written. 689d9a4c607SNiels Sascha Reedijk \exception std::bad_alloc In case it is not possible to allocate internal buffers. 690d9a4c607SNiels Sascha Reedijk 691d9a4c607SNiels Sascha Reedijk \since Haiku R1 692d9a4c607SNiels Sascha Reedijk*/ 693d9a4c607SNiels Sascha Reedijk 694d9a4c607SNiels Sascha Reedijk 695d9a4c607SNiels Sascha Reedijk/*! 696d9a4c607SNiels Sascha Reedijk \fn BString BHttpRequest::HeaderToString() const 697d9a4c607SNiels Sascha Reedijk \brief Serialize the HTTP Header of this request to a string. 698d9a4c607SNiels Sascha Reedijk 699d9a4c607SNiels Sascha Reedijk The HTTP header consists of the request line, and the fields, serialized as text according to 700d9a4c607SNiels Sascha Reedijk the HTTP specification. 701d9a4c607SNiels Sascha Reedijk 702d9a4c607SNiels Sascha Reedijk This method can be used to debug requests. 703d9a4c607SNiels Sascha Reedijk 704d9a4c607SNiels Sascha Reedijk \return A new string that represents the HTTP request. 705d9a4c607SNiels Sascha Reedijk 706d9a4c607SNiels Sascha Reedijk \exception std::bad_alloc In case it is not possible to allocate memory for the output string. 707d9a4c607SNiels Sascha Reedijk 708d9a4c607SNiels Sascha Reedijk \since Haiku R1 709d9a4c607SNiels Sascha Reedijk*/ 710d9a4c607SNiels Sascha Reedijk 711d9a4c607SNiels Sascha Reedijk 712d9a4c607SNiels Sascha Reedijk//! @} 713d9a4c607SNiels Sascha Reedijk 714d9a4c607SNiels Sascha Reedijk 715ec865cb8SNiels Sascha Reedijk} // namespace Network 716ec865cb8SNiels Sascha Reedijk 717ec865cb8SNiels Sascha Reedijk} // namespace BPrivate 718ec865cb8SNiels Sascha Reedijk 719ec865cb8SNiels Sascha Reedijk#endif 720