diff options
Diffstat (limited to 'src/zenhttp/httpclient_test.cpp')
| -rw-r--r-- | src/zenhttp/httpclient_test.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/zenhttp/httpclient_test.cpp b/src/zenhttp/httpclient_test.cpp index 67cbaea9b..deaeca2a8 100644 --- a/src/zenhttp/httpclient_test.cpp +++ b/src/zenhttp/httpclient_test.cpp @@ -414,6 +414,17 @@ TEST_CASE("httpclient.post") CHECK_EQ(Resp.AsText(), "{\"key\":\"value\"}"); } + SUBCASE("POST with content type override via additional header") + { + const char* Payload = "test payload"; + IoBuffer Buf(IoBuffer::Clone, Payload, strlen(Payload)); + + HttpClient::Response Resp = Client.Post("/api/test/echo", Buf, ZenContentType::kJSON, {{"Content-Type", "text/plain"}}); + CHECK(Resp.IsSuccess()); + CHECK_EQ(Resp.AsText(), "test payload"); + CHECK_EQ(Resp.ResponsePayload.GetContentType(), ZenContentType::kText); + } + SUBCASE("POST with CbObject payload round-trip") { CbObjectWriter Writer; |