Merge branch 'v1.3.0' into buffered_streams

This commit is contained in:
Benedikt-Alexander Mokroß 2021-08-18 09:22:30 +02:00 committed by GitHub
commit 341812cf29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 0 deletions

View File

@ -9,9 +9,11 @@ Contents:
- [The New oatpp::String](#the-new-oatppstring)
- [ConnectionPool::get() Timeout](#connectionpoolget-timeout)
- [JSON Serializer Escape Flags](#json-serializer-escape-flags)
- [Response::getBody()](#responsegetbody)
- [data::stream::FIFOStream](#datastreamfifostream)
- [data::stream::BufferedInputStream](#datastreambufferedinputstream)
## The New oatpp::String
Now it's much easier to use `oatpp::String` since `oatpp::String` is now wrapper over `std::string`
@ -119,6 +121,11 @@ Output:
res='"https://oatpp.io/"' # solidus isn't escaped
```
## Response::getBody()
`oatpp::web::protocol::http::outgoing::Response` has a new method `getBody()` to retreive the body of the response. This is handy for response interceptors.
## data::stream::FIFOStream
The new `FIFOStream` stream is a buffered
@ -133,6 +140,7 @@ buffered in a single stream.
However, it is not synchronized, so be careful when using `FIFOStream` in a multithreaded manner.
You need to implement your own locking.
## data::stream::BufferedInputStream
`FIFOStream` also introduced a new interface

View File

@ -48,6 +48,10 @@ protocol::http::Headers& Response::getHeaders() {
return m_headers;
}
std::shared_ptr<Body> Response::getBody() const {
return m_body;
}
void Response::putHeader(const oatpp::String& key, const oatpp::String& value) {
m_headers.put(key, value);
}

View File

@ -89,6 +89,12 @@ public:
*/
Headers& getHeaders();
/**
* Get body
* @return - &id:oatpp::web::protocol::http::outgoing::Body;
*/
std::shared_ptr<Body> getBody() const;
/**
* Add http header.
* @param key - &id:oatpp::String;.