Skip to content

Commit

Permalink
Fix and add doc (qicosmos#391)
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos authored Aug 22, 2023
1 parent ab4efd9 commit 9a6340f
Show file tree
Hide file tree
Showing 3 changed files with 494 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,9 @@ cinatra目前支持了multipart和octet-stream格式的上传。
}

## cinatra客户端使用

[使用文档](lang/coro_http_client_introduction.md)

### sync_send get/post message

```
Expand Down
7 changes: 6 additions & 1 deletion include/cinatra/coro_http_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,12 @@ class coro_http_client {
#endif

// return body_, the user will own body's lifetime.
std::string release_buf() { return std::move(body_); }
std::string release_buf() {
if (body_.empty()) {
return std::move(resp_chunk_str_);
}
return std::move(body_);
}

// only make socket connet(or handshake) to the host
async_simple::coro::Lazy<resp_data> connect(std::string uri) {
Expand Down
Loading

0 comments on commit 9a6340f

Please sign in to comment.