History log of /haiku/src/tests/kits/net/netservices2/HttpProtocolTest.h
Revision Date Author Comments
# 71e29bbe 29-Oct-2022 Niels Sascha Reedijk <niels.reedijk@gmail.com>

NetServices: format code using `haiku-format`

This commit formats all the netservices2 code with the `haiku-format` tool from
https://github.com/owenca/haiku-format (commit aa7408e), with the following
customizations:
* SpaceBeforeRangeBasedForLoopColon is set to false
* Braces before a catch block are not wrapped
* Most headers, except for ExclusiveBorrow.h, have been manually reformatted
to adhere to Haiku's header format (issue #19 in the repository)

Change-Id: I693c4515cf26402e48f35d1213ab6d5fcf14bd1e


# 27196c40 04-Sep-2022 Niels Sascha Reedijk <niels.reedijk@gmail.com>

NetServices: use BBorrow<BDataIO> for custom body targets

Change-Id: Ib2d4b0ca3689338d906f943295278c086c6f2c83


# aa8ca18a 14-Aug-2022 Niels Sascha Reedijk <niels.reedijk@gmail.com>

NetServices: Implement a logger for requests.

This logger can print to console or log to file.

Change-Id: I7eef847d42b360af1cb7cec0c897131b975a1f2f


# c7f925c3 06-Aug-2022 Niels Sascha Reedijk <niels.reedijk@gmail.com>

NetServices: add the HttpSerializer helper to help serialize requests

Change-Id: Ide1e2d387884ce4cf2d406057960cd0732d61f38


# 92357c13 23-Jun-2022 Niels Sascha Reedijk <niels.reedijk@gmail.com>

NetServices: Add support for an input body in a request and handle this with redirects.

Change-Id: Id2399d49aa673469c8c04ebd13884cdbcb24112d


# 6cbbd9bf 03-Jun-2022 Niels Sascha Reedijk <niels.reedijk@gmail.com>

NetServices: Implement BHttpSession::Cancel()

Change-Id: Iff0a7726e57f3e6bd4e9d0ebac08a370d25a62d7


# 2f3b9b18 03-Jun-2022 Niels Sascha Reedijk <niels.reedijk@gmail.com>

NetServices: Add/rework the MaxRedirections, Timeout and StopOnError options

Change-Id: I4e59b51c16c6777941dc92ce02505386257dad03


# f9d9d202 29-May-2022 Niels Sascha Reedijk <niels.reedijk@gmail.com>

NetServices: Add support for Basic authentication

Change-Id: I304104f7096fd935212e1bfa3e988e7945cb5cec


# cf54474e 06-May-2022 Niels Sascha Reedijk <niels.reedijk@gmail.com>

NetServices: Implement BHttpTime, parse_http_time() and format_http_time().

These utilities convert timestamp strings that are formatted according to
the HTTP RFC into BDateTime objects, and vice versa.

Change-Id: Ia2498944fb63d09233839f19d08f15d82a0a9685


# 13bfff7b 23-Apr-2022 Niels Sascha Reedijk <niels.reedijk@gmail.com>

NetServices: Implement BHttpStatusCode, BHttpStatusClass and Redirects

The user of the API can set whether redirects should be followed, and if so,
how many. This is part of the BHttpRequest API. The BHttpSession then follows
those instructions, and executes the maximum number of redirects the user
would like to follow.

As part of this commit, the BHttpStatusClass and BHttpStatusCodes helper enums
have been added, to give a friendlier access to HTTP status codes and status
classes.

Change-Id: Ic8c9e3fda158e2cce549c8f1d360951f7ac83311


# 59c359e5 18-Apr-2022 Niels Sascha Reedijk <niels.reedijk@gmail.com>

NetServices: implement support for HEAD requests and 204 responses.

These particular responses will not have a body. This is now handled by the
BHttpSession object. There is also a minor fix in here that prevents a crash
when multiple requests are handled by the DataThread at the same time, and not
all of the requests have events.

Change-Id: I7f47d8b3cd8491c8193275be4b3fc1080780fa20


# d482381d 14-Apr-2022 Niels Sascha Reedijk <niels.reedijk@gmail.com>

NetServices: partial implementation of the receive function

This initial implementation contains a lot of extra debuggin output that will
be removed in future changes. It is now possible to run a simple GET request
to the test server with gzip encoding.

Change-Id: I2c402e5cf80b94b366563888222a891a1b094b7a


# 1d2070c7 04-Apr-2022 Niels Sascha Reedijk <niels.reedijk@gmail.com>

NetServices: add testserver.py and proxy.py test infrastructure

This adds the existing testing facilities to the netservices2kit.

Change-Id: Idd884a800abda967bc4b65a416a5f6d927f37450


# 02ea57d7 03-Apr-2022 Niels Sascha Reedijk <niels.reedijk@gmail.com>

NetServices: Introduce BHttpRequestStream and abstract interface.

This supports asynchronous transfers of Http Requests to a network
interface.

Change-Id: I845fb2e08160d219f85b7a08d2d8872ac7359b47


# 3b172a3d 07-Mar-2022 Niels Sascha Reedijk <niels.reedijk@gmail.com>

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


# 6ce6e964 25-Feb-2022 Niels Sascha Reedijk <niels.reedijk@gmail.com>

NetServices: Introduce BHttpRequest class

Objects of this class describe a HTTP request. It contains several convenience
functions that will allow a user to describe the properties of the request.
More options to be added later.

Change-Id: If6a00d26808c5ed4b121cb36dc75a2a1cc449f95


# ec865cb8 20-Feb-2022 Niels Sascha Reedijk <niels.reedijk@gmail.com>

NetServices: Add BHttpMethod that represents a HTTP method

This class provides defaults and performs basic validation for HTTP Methods as
defined by the standard. They will be used in conjunction with a future
BHttpRequest class.

Change-Id: If69a7ec186d9d1165e8efe5ab5df50d5a089208d


# a8003a70 08-Feb-2022 Niels Sascha Reedijk <niels.reedijk@gmail.com>

NetServices: Introduce BHttpFields to query and manipulate fields in HTTP messages

HTTP messages (requests and responses) have a header section that can contain
HTTP headers. These headers consist of name, value pairs. This class can be
used to query the headers on a response, and build a list of headers for a
request.

The internal implementation is designed around two different methods of storing
the underlying data. For HTTP requests, the name, value pairs are stored as
owned BString objects. For responses, the assumption is that there is a byte
buffer that contains the data and that has the same lifetime as the BHttpFields
object. The name, value pairs will then be stored as std::string_view to the
underlying buffer.

Still to do is:
- The method to convert a BHttpFields list into a string buffer to transmit.
- The method to parse a string buffer and turn it into a BHttpFields object.

Change-Id: I4819db100aa1671aa7403675216a4c85fd221da7


# 34522da9 15-Dec-2021 Niels Sascha Reedijk <niels.reedijk@gmail.com>

netservices: add BHttpHeader class and BHttpHeaderMap skeleton

Change-Id: I36a7c757a6909604d749355ecb1a9d42d05d7306