载入中...
搜索中...
未找到
eve::service::INetwork类 参考abstract

Minimal synchronous HTTP request surface. Providers: eve::network::Network. Mocks return canned status codes / errors, so consumers can test 404 / timeout / TLS paths without a network. 更多...

#include <ServiceInterfaces.h>

类 eve::service::INetwork 继承关系图:
eve::network::Network

Public 成员函数

virtual ~INetwork ()=default
 Releases INetwork resources.
 
virtual bool httpRequest (const std::string &method, const std::string &url, const std::string &body, int timeoutMs, int &status, std::string &responseBody)=0
 Performs one HTTP request synchronously.
 

静态 Public 属性

static constexpr const char * capabilityName = "INetwork"
 

详细描述

Minimal synchronous HTTP request surface. Providers: eve::network::Network. Mocks return canned status codes / errors, so consumers can test 404 / timeout / TLS paths without a network.

在文件 ServiceInterfaces.h 第 42 行定义.

构造及析构函数说明

◆ ~INetwork()

virtual eve::service::INetwork::~INetwork ( )
virtualdefault

Releases INetwork resources.

成员函数说明

◆ httpRequest()

virtual bool eve::service::INetwork::httpRequest ( const std::string &  method,
const std::string &  url,
const std::string &  body,
int  timeoutMs,
int &  status,
std::string &  responseBody 
)
pure virtual

Performs one HTTP request synchronously.

参数
method"GET" / "POST" / ...
urlFull URL.
bodyRequest body (empty for GET).
timeoutMsTimeout in milliseconds.
[out]statusHTTP status code (only meaningful when returning true).
[out]responseBodyResponse body bytes.
返回
false on transport error / timeout; true when a response arrived.

在 eve::network::Network 内被实现.

类成员变量说明

◆ capabilityName

constexpr const char* eve::service::INetwork::capabilityName = "INetwork"
staticconstexpr

在文件 ServiceInterfaces.h 第 44 行定义.


该类的文档由以下文件生成: