Loading...
Searching...
No Matches
Namespaces | Classes | Enumerations | Functions
BPrivate::Network Namespace Reference

Experimental Network Services API. More...

Namespaces

namespace  UrlEvent
 Contains the message constants that are sent by the various protocols.
 
namespace  UrlEventData
 Contains the names of the data in the messages that are sent by the various protocols.
 

Classes

class  BBorrow
 Smart pointer that borrows an object from a BExclusiveBorrow owner. More...
 
class  BBorrowError
 Error while handling a BExclusiveBorrow or BBorrow object. More...
 
class  BError
 Abstract base class for advanced error objects. More...
 
class  BExclusiveBorrow
 Smart pointer that allows shared ownership of an object with exclusive access. More...
 
struct  BHttpAuthentication
 Describe username and password for basic authentication for the request. More...
 
struct  BHttpBody
 Represents a HTTP response body. More...
 
class  BHttpFields
 Represents the field section of a HTTP header. More...
 
class  BHttpMethod
 Represent a HTTP method. More...
 
class  BHttpRequest
 Represent a HTTP request. More...
 
class  BHttpResult
 Unique object to wait for and access a HTTP response data. More...
 
class  BHttpSession
 Schedule, execute and manage HTTP requests. More...
 
struct  BHttpStatus
 Represents the HTTP status code and status text of an incoming response. More...
 
class  BHttpTime
 Utility class that can parse and format HTTP Date strings. More...
 
class  BInvalidUrl
 Error that indicates that the URL is not valid. More...
 
class  BNetworkRequestError
 Error that indicates there was an issue executing the network request. More...
 
class  BRuntimeError
 Advanced error object for runtime errors. More...
 
class  BSystemError
 Advanced error object that wrap low-level system errors. More...
 
class  BUnsupportedProtocol
 Error that indicates that the protocol is not supported. More...
 

Enumerations

enum class  BHttpStatusClass : int16
 Category of the HTTP response status code.
 
enum class  BHttpStatusCode : int16
 Enumeration of standardized HTTP status codes.
 
enum class  BHttpTimeFormat : int8
 Describes the three time formats supported by the HTTP RFC.
 

Functions

BString encode_to_base64 (const BString &string)
 Utility function that encodes a string to base64 and returns the result.
 
BString format_http_time (BDateTime timestamp, BHttpTimeFormat outputFormat=BHttpTimeFormat::RFC1123)
 Format the timestamp into a string according to the outputFormat.
 
template<class T , class... _Args>
BExclusiveBorrow< T > make_exclusive_borrow (_Args &&... __args)
 Create a new object that is managed by a BExclusiveBorrow smart pointer.
 
BDateTime parse_http_time (const BString &string)
 Parse a string that contains a timestamp and return a BDateTime object.
 

Detailed Description

Experimental Network Services API.

See Experimental Network Services Support for more information.

Function Documentation

◆ encode_to_base64()

BString BPrivate::Network::encode_to_base64 ( const BString string)

Utility function that encodes a string to base64 and returns the result.

Since
Haiku R1

◆ format_http_time()

BString BPrivate::Network::format_http_time ( BDateTime  timestamp,
BHttpTimeFormat  outputFormat = BHttpTimeFormat::RFC1123 
)

Format the timestamp into a string according to the outputFormat.

See the description of the module in HttpTime.h for more information about HTTP timestamps.

Parameters
timestampA valid BDateTime object for the desired timestamp.
outputFormatThe requested outputformat. The default is the recommended RFC 1123 format.
Returns
A string that contains the formatted timestamp.
Exceptions
BHttpTime::InvalidInputThe date does not contain a valid timestamp.
std::bad_allocIn the future this method may throw this exception when the memory for the output string cannot be allocated.
See also
BHttpTime parse_http_time()
Since
Haiku R1

◆ parse_http_time()

BDateTime BPrivate::Network::parse_http_time ( const BString string)

Parse a string that contains a timestamp and return a BDateTime object.

See the description of the module in HttpTime.h for more information about HTTP timestamps.

Parameters
stringA string that contains a valid HTTP timestamp. The dateString must not contain any characters, other than the timestamp. It is up to the caller to sanitize any input, including trimming whitespace at the beginning and end of the string.
Exceptions
BHttpTime::InvalidInputThe string cannot be parsed as a valid timestamp.
See also
BHttpTime format_http_time()
Since
Haiku R1