Sese Framework
x.y.z
A cross-platform framework
|
可请求接口 更多...
#include <Requestable.h>
Public 类型 | |
using | WriteCallback = std::function<int64_t(const void *, size_t)> |
using | ReadCallback = std::function<int64_t(void *, size_t)> |
Public 类型 继承自 sese::io::InputStream | |
typedef std::shared_ptr< InputStream > | Ptr |
Public 类型 继承自 sese::io::OutputStream | |
typedef std::shared_ptr< OutputStream > | Ptr |
Public 成员函数 | |
~Requestable () override=default | |
virtual bool | request ()=0 |
virtual int | getLastError ()=0 |
virtual std::string | getLastErrorString ()=0 |
int64_t | read (void *buf, size_t len) override=0 |
int64_t | write (const void *buf, size_t len) override=0 |
Request::Ptr & | getRequest () |
Response::Ptr & | getResponse () |
void | setReadData (io::PeekableStream *read_data, size_t expect_total) |
void | setWriteData (io::OutputStream *write_data) |
void | setReadCallback (const ReadCallback &read_callback, size_t expect_total) |
void | setWriteCallback (const WriteCallback &write_callback) |
void | reset () |
重置 body 相关设置 | |
Public 成员函数 继承自 sese::io::InputStream | |
virtual | ~InputStream () noexcept=default |
Public 成员函数 继承自 sese::io::OutputStream | |
virtual | ~OutputStream () noexcept=default |
int64_t | write (const std::string_view &buffer) |
int64_t | write (const text::StringView &buffer) |
template<typename T > | |
int64_t | write (std::vector< T > &buffer) |
template<typename T , size_t N> | |
int64_t | write (std::array< T, N > &buffer) |
Protected 属性 | |
Request::Ptr | req = nullptr |
Response::Ptr | resp = nullptr |
size_t | expect_total = 0 |
io::PeekableStream * | read_data = nullptr |
io::OutputStream * | write_data = nullptr |
WriteCallback | write_callback |
ReadCallback | read_callback |
可请求接口
using sese::net::http::Requestable::ReadCallback = std::function<int64_t(void *, size_t)> |
using sese::net::http::Requestable::WriteCallback = std::function<int64_t(const void *, size_t)> |
|
overridedefault |
|
pure virtual |
|
pure virtual |
|
inline |
|
inline |
|
overridepure virtual |
|
pure virtual |
|
inline |
重置 body 相关设置
引用了 expect_total, read_callback, read_data, req, resp, write_callback , 以及 write_data.
被这些函数引用 sese::internal::net::http::HttpClientImpl::HttpClientImpl() , 以及 sese::internal::net::http::HttpClientImpl::request().
|
inline |
设置请求 body 外部来源,此选项将在请求完成后重置
read_callback | body 读取来源回调函数,返回读取大小,读取不完全则终止传输 |
expect_total | body 预计大小 |
引用了 expect_total , 以及 read_callback.
|
inline |
设置请求 body 外部来源,此选项将在请求完成后重置
read_data | body 读取来源 |
expect_total | body 预计大小 |
引用了 expect_total , 以及 read_data.
|
inline |
|
inline |
|
overridepure virtual |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |