userver
C++ Async Framework
Loading...
Searching...
No Matches
samples/hello_service/src/hello_handler.cpp
#include "hello_handler.hpp"
#include "say_hello.hpp"
namespace
samples::hello {
std::string HelloHandler::HandleRequestThrow(
const
server::http::HttpRequest
& request,
server::request::RequestContext
&
/*request_context*/
)
const
{
// Setting Content-Type: text/plain in a microservice response ensures
// the client interprets it as plain text, preventing misinterpretation or
// errors. Without this header, the client might assume a different format,
// such as JSON, HTML or XML, leading to potential processing issues or
// incorrect handling of the data.
request.
GetHttpResponse
().
SetContentType
(http::content_type::kTextPlain);
return
samples::hello::SayHelloTo(request.
GetArg
(
"name"
));
}
}
// namespace samples::hello
Generated on Thu Oct 3 2024 13:06:53 for userver by
Doxygen
1.10.0