|
🛰️航天仿真算法库 SpaceAST 0.0.1
|
#include <NetworkRequest.hpp>
Public 成员函数 | |
| ENetworkRequestMethod | method () const |
| void | setMethod (ENetworkRequestMethod method) |
| AST_UTIL_API void | setMethod (StringView method) |
| const std::string & | url () const |
| void | setUrl (const std::string &url) |
| const std::string & | body () const |
| void | setBody (const std::string &body) |
| AST_UTIL_API void | setJson (const JsonValue &json) |
| AST_UTIL_API errc_t | toJson (JsonValue &json) const |
| AST_UTIL_API JsonValue | toJson () const |
| const std::map< std::string, std::string > & | headers () const |
| void | setHeaders (const std::map< std::string, std::string > &headers) |
| void | addHeader (const std::string &key, const std::string &value) |
| void ast::NetworkRequest::setMethod | ( | StringView | method | ) |
设置网络请求方法
从字符串视图设置网络请求方法,支持 GET、POST、PUT、DELETE 等方法。
| JsonValue ast::NetworkRequest::toJson | ( | ) | const |
获取网络请求体为 JSON 格式
| errc_t ast::NetworkRequest::toJson | ( | JsonValue & | json | ) | const |
获取网络请求体为 JSON 格式