Commit 0727817a authored by ciody's avatar ciody

Merge remote-tracking branch 'upstream/master'

parents 6c408d5c f8a3a766
...@@ -69,14 +69,13 @@ Some other CMAKE defines: ...@@ -69,14 +69,13 @@ Some other CMAKE defines:
using namespace Pistache; using namespace Pistache;
struct HelloHandler : public Http::Handler { struct HelloHandler : public Http::Handler {
HTTP_PROTOTYPE(HelloHandler) HTTP_PROTOTYPE(HelloHandler)
void onRequest(const Http::Request&, Http::ResponseWriter writer) override{
void onRequest(const Http::Request& request, Http::ResponseWriter writer) { writer.send(Http::Code::Ok, "Hello, World!");
writer.send(Http::Code::Ok, "Hello, World!"); }
}
}; };
int main() { int main() {
Http::listenAndServe<HelloHandler>("*:9080"); Http::listenAndServe<HelloHandler>("*:9080");
} }
``` ```
...@@ -14,7 +14,7 @@ public: ...@@ -14,7 +14,7 @@ public:
HTTP_PROTOTYPE(HelloHandler) HTTP_PROTOTYPE(HelloHandler)
void onRequest(const Http::Request& request, Http::ResponseWriter response) { void onRequest(const Http::Request& request, Http::ResponseWriter response) override{
UNUSED(request); UNUSED(request);
response.send(Pistache::Http::Code::Ok, "Hello World\n"); response.send(Pistache::Http::Code::Ok, "Hello World\n");
} }
......
/* /*
Mathieu Stefani, 07 février 2016 Mathieu Stefani, 07 février 2016
* Http client example * Http client example
*/ */
......
/* /*
Mathieu Stefani, 07 février 2016 Mathieu Stefani, 07 février 2016
Example of a REST endpoint with routing Example of a REST endpoint with routing
*/ */
......
...@@ -31,6 +31,7 @@ namespace Http { ...@@ -31,6 +31,7 @@ namespace Http {
CODE(100, Continue, "Continue") \ CODE(100, Continue, "Continue") \
CODE(101, Switching_Protocols, "Switching Protocols") \ CODE(101, Switching_Protocols, "Switching Protocols") \
CODE(102, Processing, "Processing") \ CODE(102, Processing, "Processing") \
CODE(103, Early_Hints, "Early Hints") \
CODE(200, Ok, "OK") \ CODE(200, Ok, "OK") \
CODE(201, Created, "Created") \ CODE(201, Created, "Created") \
CODE(202, Accepted, "Accepted") \ CODE(202, Accepted, "Accepted") \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment