diff options
| author | Stefan Boberg <[email protected]> | 2023-05-15 18:53:38 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-15 18:53:38 +0200 |
| commit | 3fb79e25865c3bafa9156c2db767ddc16f5019f3 (patch) | |
| tree | d476cf8c3b05793642b1a029171d76dfcf9f092d /src/zenhttp/include | |
| parent | added trace::DescribeSession to TraceInit (diff) | |
| download | zen-3fb79e25865c3bafa9156c2db767ddc16f5019f3.tar.xz zen-3fb79e25865c3bafa9156c2db767ddc16f5019f3.zip | |
Better defaults for zen cli (#302)
added ZenCmdBase::ResolveTargetHostSpec - this is a helper which provides better default behaviour for commands which interact with a local zen server instance. more specifically it picks a default based on which processes are actually running on the local machine
this change also wires up the Scrub command along with some required HttpClient improvements
Diffstat (limited to 'src/zenhttp/include')
| -rw-r--r-- | src/zenhttp/include/zenhttp/httpclient.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/zenhttp/include/zenhttp/httpclient.h b/src/zenhttp/include/zenhttp/httpclient.h index edf3bf773..9f08835d3 100644 --- a/src/zenhttp/include/zenhttp/httpclient.h +++ b/src/zenhttp/include/zenhttp/httpclient.h @@ -35,13 +35,18 @@ public: // validate that the content type or content itself makes sense as a string. std::string_view AsText(); - bool IsSuccess() const noexcept; - inline explicit operator bool() const noexcept { return IsSuccess(); } + // Return text representation of the payload. Formats into JSON for structured + // objects, returns text as-is for text types like Text, JSON, HTML etc + std::string ToText(); + + bool IsSuccess() const noexcept; + inline operator bool() const noexcept { return IsSuccess(); } }; [[nodiscard]] Response Put(std::string_view Url, const IoBuffer& Payload); [[nodiscard]] Response Get(std::string_view Url); [[nodiscard]] Response Delete(std::string_view Url); + [[nodiscard]] Response Post(std::string_view Url); [[nodiscard]] Response Post(std::string_view Url, const IoBuffer& Payload); [[nodiscard]] Response Post(std::string_view Url, CbObject Payload); [[nodiscard]] Response Post(std::string_view Url, CbPackage Payload); |