userver
C++ Async Framework
Toggle main menu visibility
Documentation
API Groups
Namespaces
Reference
Class List
Class Index
File List
Macros
All
e
i
l
r
t
u
Functions
Macros
e
i
l
r
t
u
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
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::HandleRequest(
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 Wed Apr 30 2025 15:48:39 for userver by
Doxygen
1.13.2