Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pistache
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
pistache
Commits
0727817a
Commit
0727817a
authored
Feb 09, 2019
by
ciody
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master'
parents
6c408d5c
f8a3a766
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
11 deletions
+11
-11
README.md
README.md
+5
-6
examples/hello_server.cc
examples/hello_server.cc
+1
-1
examples/http_client.cc
examples/http_client.cc
+2
-2
examples/rest_server.cc
examples/rest_server.cc
+2
-2
include/pistache/http_defs.h
include/pistache/http_defs.h
+1
-0
No files found.
README.md
View file @
0727817a
...
@@ -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"
);
}
}
```
```
examples/hello_server.cc
View file @
0727817a
...
@@ -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
"
);
}
}
...
...
examples/http_client.cc
View file @
0727817a
/*
/*
Mathieu Stefani, 07 février 2016
Mathieu Stefani, 07 février 2016
* Http client example
* Http client example
*/
*/
...
...
examples/rest_server.cc
View file @
0727817a
/*
/*
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
*/
*/
...
...
include/pistache/http_defs.h
View file @
0727817a
...
@@ -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") \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment